Seperating links in page template

General ShopSite user discussion

Seperating links in page template

Postby jontaco » Wed Jun 22, 2011 9:44 am

I need to be able to separate a list of page links into 2 separate drop-down boxes. The first list is just called "Categories", the second list is "Years". Here you can see my 2 drop down boxes:
http://mulberrystreetgifts.com/store/boyds/NEW_accessories.php

The problem is that all these page links have been added to 1 page in the SS back office.
If you look closely, you will notice that both drop down boxes loop through all of the page links, but clearly one set of links is named by category (i.e. Accessories...Treasure Boxes), while the other set is named by Year (2006...2012)

Is there any way to divide this 1 list of page links into 2 separate drop down boxes?

If it helps, here is what the page template looks like:

Code: Select all
[-- DEFINE LINK_TO_PAGE --]
       <!-- Output option HTML tag. The function menu_goto() adds base url -->
        <option value="/[-- Page.FileName --]">[-- PAGE.Name --]</option>
[-- END_DEFINE LINK_TO_PAGE --]

[-- DEFINE PAGE --]

...

<form action="dummyvalue1">
Category:<br>
<select name="newurl" onChange="menu_goto(this.form)" id="search_field1" class="search"/>
<option value="" selected="selected">- Select a Category-</option>
[-- INCLUDE link-loop.php PROCESS --]
</select>
</form>

<form action="dummyvalue2">
Year:<br>
<select name="newurl" onChange="menu_goto(this.form)" id="search_field1" class="search"/>
<option value="" selected="selected">- Select a Year-</option>
[-- INCLUDE link-loop.php PROCESS --]
</select>
</form>           

...

Product loop goes here

[-- END_DEFINE PAGE --]
jontaco
 
Posts: 39
Joined: Sun Apr 20, 2008 8:05 pm
Location: Huntsville, AL

Re: Seperating links in page template

Postby robm » Wed Jun 22, 2011 10:42 am

We have a tutorial on this very feature, putting page links in different dropdown boxes. Reference:

http://support.lexiconn.com/news/viewtopic.php?t=348

Rob
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut

Re: Seperating links in page template

Postby Jim » Wed Jun 22, 2011 10:49 am

Use some field, such as one of the extra page fields, to indicate whether a page is a "Categories" or a "Years" page.

Then in your page template have two separate sections and loop through the links in each section checking page.fieldX to see if it is what you want to output. If the page.fieldx is Categories and you are in the Categories section then output the html for that link otherwise don't do anything. Same for the Years section, loop through the links and if the page.fields is Years output the html for the link otherwise don't output anything.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Seperating links in page template

Postby jontaco » Wed Jun 22, 2011 11:29 am

This worked perfectly! Thanks!
jontaco
 
Posts: 39
Joined: Sun Apr 20, 2008 8:05 pm
Location: Huntsville, AL


Return to User Forum

Who is online

Users browsing this forum: Bing [Bot] and 50 guests