Nested links

General ShopSite user discussion

Nested links

Postby redskys » Fri Oct 05, 2007 10:50 am

I want to generate a navbar with links and sublinks, like this: (Please ignore the bad spacing). The normal links would go directly to the product page, while the bold links would go to an info page that would then link to the product pages.

    Cars
      Lasalle

      Packard
    Donuts
      Plain

      Jelly


etc.

My question is this: How can I tag or distinguish the links as "bold not padded" or "normal padded left" so that when the product template is processing the "Looplinks routine, it can apply the proper style information?

I will apologize in advance if this has been answered; if it has, I wasn't able to formulate the proper search query to find it.

Thanks.

Redskys
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am

Postby loren_d_c » Fri Oct 05, 2007 11:46 am

I don't know if you can do this in the LOOP LINKS loop in the page template, but where the [-- LINK --] tag is in this loop will be replaced with whatever is in the DEFINE LINK_TO_PAGE section of the template assigned to the page being linked to, so in the DEFINE LINK_TO_PAGE you could put the class assignment around the link and pull the class name from one of the Extra Page Fields (if you have ShopSite Pro, there will either be 5 or 10 extra page fields (depending on your version) that can be used for purposes such as this).

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Nested links

Postby redskys » Fri Oct 05, 2007 12:03 pm

Thanks Loren.

I take it that whatever is generated by the define link routine is copied verbatim, html, css and all by way of the [-- LINK --] tag. Is that correct?

It would be easy to put a flag and class info in one of the extra page fields.

Thanks again.

Redskys
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am

Postby loren_d_c » Fri Oct 05, 2007 12:51 pm

Yes (note the LINK tag is only valid within the LOOP LINKS loop), verbatim except for, of course, and other ShopSite template tags, which will be processed and replaced with whatever data they represent from that page record. For example, if you placed your class name in the Extra Page Field 1, then your DEFINE LINK_TO_PAGE section might look something similar to this:

Code: Select all
[-- DEFINE LINK_TO_PAGE --]
<a href="[-- OUTPUT_DIRECTORY_URL --]/[-- Page.FileName --]" class="[-- PAGE.Field1 --]">
[-- IF PAGE.LinkName --]
  [-- PAGE.LinkName --]
[-- ELSE --]
  [-- PAGE.Name --]
[-- END_IF --]
</a>
[-- END_DEFINE LINK_TO_PAGE --]


-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: No registered users and 90 guests