Announcement

Collapse
No announcement yet.

How do I create a section list that highlights the current section?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I create a section list that highlights the current section?

    This technique will show you how to include a section list in the store where the 'current' section (i.e. the one the customer is currently on) is highlighted. In this case it is made a different colour, but you can adapt this code as required. This technique uses the 'Advanced Lists' as described in the next chapter.

    Copy and paste the following code into your layouts where you want the section list to appear:

    HTML Code:
    <actinic:block type="TopLevelSectionList" >
    
    <a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self">
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionID%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionID%22%20%2f%3e"><span style="color: green;"><strong></actinic:block>
    
    <actinic:variable name='SectionName'/>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionID%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionID%22%20%2f%3e"><<</strong></span></actinic:block>
    
    </a>
    
    <br />
    
    </actinic:block>
    You'll need to adapt this code to get it looking as you need it – look at the two block if tags above and below the SectionName variable. They are what changes the formatting of the link in specific sections.

    It is possible to adapt this trick to keep the section highlighted even if you go into a sub-section within the section.

    To do this, you first need to create a new user definable variable called 'SectionNumber' as follows:

    1. Go to 'Design | Library | Variables'.
    2. Right-click on 'Section' and select 'New Variable'.
    3. In the 'Name' field, enter 'SectionNumber'.
    4. In the 'Prompt' field, enter 'Section Number'.
    5. Under 'Place of Setting' select 'Section'.
    6. Now go to your first main top-level section in the content tree and change to the 'Properties' tab.
    7. Set the value of 'Section Number' as '1'.
    8. Repeat this for all your other main top-level sections, using a different number for each section.
    9. Now use the following code for the section list:

    HTML Code:
    <actinic:block type="TopLevelSectionList" >
    
    <a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self">
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionNumber%22%20%2f%3e" ><span style="color: green;"><strong></actinic:block>
    
    <actinic:variable name='SectionName'/>
    
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionNumber%22%20%2f%3e" ><<</strong></span></actinic:block>
    
    </a>
    
    <br />
    </actinic:block>
Working...
X