Kryptronic Software Support Forum

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.

#1 05-01-2004 03:00:22

Steven
Member
Registered: 04-21-2004
Posts: 84

Dropdown Categories

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 wink 

Offline

 

#2 05-01-2004 03:38:36

Brains
Member
Registered: 08-22-2003
Posts: 200

Re: Dropdown Categories

Check this post:



BRAINS


International Award Winning Professional Web Design
MySQL Database Design, PHP
UK Hosting on Dedicated Servers
As featured in the Financial Times, ISP World and others.

Offline

 

#3 05-01-2004 05:46:50

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Dropdown Categories

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

 

#4 05-01-2004 08:48:02

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Dropdown Categories

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. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#5 05-01-2004 12:05:46

Jubba
Member
Registered: 03-25-2004
Posts: 91

Re: Dropdown Categories

Hiya

Take a look at my site:



Is that the kind of menu you want?

Jub

Offline

 

#6 05-01-2004 12:11:15

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Dropdown Categories

Jubba,

Your page are roll-over menus. This user needs a single selection list menu on his header.


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#7 05-01-2004 13:48:36

Brains
Member
Registered: 08-22-2003
Posts: 200

Re: Dropdown Categories

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


International Award Winning Professional Web Design
MySQL Database Design, PHP
UK Hosting on Dedicated Servers
As featured in the Financial Times, ISP World and others.

Offline

 

#8 05-01-2004 15:23:44

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Dropdown Categories

Brains,

Do you think this could be feasable the way you mentionned above by using OpenCube ?


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#9 05-01-2004 15:28:24

Brains
Member
Registered: 08-22-2003
Posts: 200

Re: Dropdown Categories

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


International Award Winning Professional Web Design
MySQL Database Design, PHP
UK Hosting on Dedicated Servers
As featured in the Financial Times, ISP World and others.

Offline

 

#10 05-01-2004 16:12:18

scoutch
Member
Registered: 07-03-2003
Posts: 3167

Re: Dropdown Categories



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. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#11 07-27-2004 18:26:07

superhero2000
Member
From: Harrisburg, PA
Registered: 03-26-2003
Posts: 1025
Website

Re: Dropdown Categories

Brains,

How would I go about using the drop down navigation as well as the typical text navigation with this Mod?


Vinh
VQC Designs, LLC


Offline

 

#12 07-27-2004 18:32:44

superhero2000
Member
From: Harrisburg, PA
Registered: 03-26-2003
Posts: 1025
Website

Re: Dropdown Categories

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. 


Vinh
VQC Designs, LLC


Offline

 

#13 08-02-2004 20:27:24

one2ku
Member
From: CA
Registered: 04-29-2004
Posts: 176
Website

Re: Dropdown Categories

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

 

#14 08-02-2004 20:31:04

one2ku
Member
From: CA
Registered: 04-29-2004
Posts: 176
Website

Re: Dropdown Categories



STEP 3: Add the following code to the head of your ste_layout file:

Where is this?

Offline

 

#15 08-03-2004 08:35:13

superhero2000
Member
From: Harrisburg, PA
Registered: 03-26-2003
Posts: 1025
Website

Re: Dropdown Categories

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.


Vinh
VQC Designs, LLC


Offline

 

#16 08-03-2004 15:56:16

one2ku
Member
From: CA
Registered: 04-29-2004
Posts: 176
Website

Re: Dropdown Categories

Thanks superhero2000, great code and easily done.

Offline

 

#17 08-18-2004 05:20:04

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Dropdown Categories

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

 

#18 08-18-2004 20:47:06

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Dropdown Categories

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

 

#19 08-18-2004 22:21:25

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Dropdown Categories

  :-)

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

 

#20 09-02-2005 07:24:30

benison
Member
Registered: 09-02-2005
Posts: 2

Re: Dropdown Categories

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

 

Board footer