You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi
Is there any way to have the different categories listed dynamically in a dropdown menu?
Could someone please show me in the right direction.
Thanks
Steven
Offline
Check this post:
BRAINS
Offline
I actually mean't like a dropdown menu like the one on amazon at the following link
up top on the right.
Browse: _______________ GO!
But i want it to be dynamic. If I add more categories, it must be updated automatically
Offline
That could be feasable by modifying ste_cat_list.txt file. What you're trying to say is that you want to implement a table. There should no problem to add this in.
Offline
Hiya
Take a look at my site:
Is that the kind of menu you want?
Jub
Offline
Jubba,
Your page are roll-over menus. This user needs a single selection list menu on his header.
Offline
From what I gather what you want is a 'Jump Menu'
This is quite a modification and you should :
: You will need to modify the file as follows
Within the ste_cat_list subroutine locate the line:
my @category = database_call('category','SELECT',$sql_statement);
Underneath add:
print <<ENDOFTEXT;
<form name="form1">
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
ENDOFTEXT
Locate the line:
@category = ();
Underneath add:
print <<ENDOFTEXT;
<input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo('menu1','parent',0)">
</select>
</form>
ENDOFTEXT
: Edit your file as follows:
<option value="(CGIVAR)common_url(/CGIVAR)&pg=cat&ref=(CGIVAR)category_id_encoded(/CGIVAR)">(CGIVAR)category_name(/CGIVAR)</option>
: Add the following code to the head of your file:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
That's it.
BRAINS
Offline
Brains,
Do you think this could be feasable the way you mentionned above by using OpenCube ?
Offline
OpenCube is totally different Scoutch.
It requires a different type of integration....as you may be aware form the previous posts via the other topic of drop down menus.
I think the above solution is quite nice though. With OpenCube the menus are not generated automatically. A menu script file needs to be amended.
BRAINS
Offline
I think the above solution is quite nice though. With OpenCube the menus are not generated automatically. A menu script file needs to be amended.
How about : Taking all readings inside the JS files and convert them into two simple lines (like my roll-over product description on my site). I'm sure that can be feasable. This is something I have to try.
Offline
Brains,
How would I go about using the drop down navigation as well as the typical text navigation with this Mod?
Offline
Nevermind, I got it working....don't you hate posting sometimes before you actually think about you want?
All I did was create another subroutine called ste_cat_list2 and called it via that.
Offline
STEP 2: Edit your ste_cat_list file as follows:
<option value="(CGIVAR)common_url(/CGIVAR)&pg=cat&ref=(CGIVAR)category_id_encoded(/CGIVAR)">(CGIVAR)category_name(/CGIVAR)</option>
What does this mean?
What do I edit?
Offline
STEP 2: Edit your ste_cat_list file as follows:
<option value="(CGIVAR)common_url(/CGIVAR)&pg=cat&ref=(CGIVAR)category_id_encoded(/CGIVAR)">(CGIVAR)category_name(/CGIVAR)</option>
This can be found in the ste_cat_list.txt file in the Elements folder.
STEP 3: Add the following code to the head of your ste_layout file:
This can be found in the ste_layout.txt file in the Elements folder.
Offline
Brains,05/01/2004 01:48:36 PM wrote:
From what I gather what you want is a 'Jump Menu'
This is quite a modification and you should :
: You will need to modify the file as follows
Within the ste_cat_list subroutine locate the line:
my @category = database_call('category','SELECT',$sql_statement);
Underneath add:
print <<ENDOFTEXT;
<form name="form1">
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
ENDOFTEXT
Locate the line:
@category = ();
Underneath add:
print <<ENDOFTEXT;
<input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo('menu1','parent',0)">
</select>
</form>
ENDOFTEXT
: Edit your file as follows:
<option value="(CGIVAR)common_url(/CGIVAR)&pg=cat&ref=(CGIVAR)category_id_encoded(/CGIVAR)">(CGIVAR)category_name(/CGIVAR)</option>
: Add the following code to the head of your file:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
That's it.
BRAINS
Brains,
This is exactly what I want, however rather than replacing the default category listing, I wanted to _add_ this to a page, have them both. This is no problem, I just add a new call in ste_layout, and add another routine in ste_cat.pl.
However, having done that, and tested working. I want to know if the javascript code could be modified a little to have the 'first' category shown in the 'jump menu' is infact the one that is currently selected, or being viewed.
Is this possible? .. It's just that having two menus active, if the user chooses a category on the default menu, and then chooses to use the jump menu next time round, the 'first' category shown on the jump menu isn't able to be selected.
Thanks
Steven
Offline
More importantly, the GO button does not appear in mozilla firefox. Hence my previous post.
If anyone has some similiar working javascript for this feature, any help and input would be greatly appreciated.
Steven
Offline
:-)
I have fixed this using a CGI script and an image for a button. No javascript required.
Anyone who wants a copy of this code, please contact me
Offline
in my ste_cat.txt , I am able to see this only
(CGIGET TYPE="SUB" VALUE="ste_exec_storehead")
(CGIGET TYPE="SUB" VALUE="ste_cat_desc")
(CGIGET TYPE="SUB" VALUE="ste_cat_disp")
(CGIGET TYPE="SUB" VALUE="ste_prod_disp")
(CGIGET TYPE="SUB" VALUE="ste_cart_shop")
I still have no idea how to add the list menu to it. Any pointers?
Offline