Announcement

Collapse
No announcement yet.

Highlight current Product Section

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

    Highlight current Product Section

    I'd like to help users identify what section they are in by highlighting the current Product Section (often part of the left-hand navigation).

    For example, suppose the Product Section list contains 'Books', 'Clothing' and 'Homeware'. If the user is in the Books section, 'Books' should appear differently in the Product Section list.

    Do you know the best way to do this?

    Many thanks,
    Dean (grand-illusions.com)

    #2
    You can use a condition for this.

    Put the code into the section link layout that does the highlighting, then highlight this code and click the 'Insert Block' button (green 'C' with a '+'). You can use the following condition:

    Code:
    <actinic:variable name="SectionName" /> == <actinic:variable name="MainSection::SectionName" />

    Comment


      #3
      Chris,

      Following on from that code how do you ensure that the same highlighting is there regardless of how many sections deep you are within a section, if you see what I mean?

      Current code is:-

      <h3><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionName%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionName%22%20%2f%3e" >
      <div style="background:#C8C8C8">
      </actinic:block><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionName%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22MainSection%3a%3aSectionName%22%20%2f%3e">
      </div>
      </actinic:block></h3>
      Cheers

      David
      Located in Edinburgh UK

      http://twitter.com/mcfinster

      Comment


        #4
        Haven't I done this for you already? I'm sure there's a post somewhere about it...

        <fx: goes and has a rummage>

        Ah - OK. A different person had asked about it in the thread you had posted in

        Check out http://community.actinic.com/showthr...t=23159&page=2 - especially my last post.

        Comment


          #5
          And todays lesson is in finishing (reading) what you start! Thanks Chris, should have noticed that!
          Cheers

          David
          Located in Edinburgh UK

          http://twitter.com/mcfinster

          Comment


            #6
            Thank you Chris for the code. I used the code to add an ID to the current product section DIV, which brings in the appropropriate CSS styling to make it stand-out from the other product sections. e.g. see 'Optical Illusions' in the left hand navigation: http://www.grand-illusions.com/acata...Illusions.html

            However, although this works for product section pages, it does not work for the Extended Informations pages. e.g. http://www.grand-illusions.com/acatalog/info_7.html

            The Extended Information layout uses the same 'Top Level Section List In Boxes' layout and so has the same conditionality and CSS.

            Any idea why it doesn't work for these pages?

            Many thanks,
            Dean

            Comment


              #7
              Hi Dean

              Looking at the code, the highlighting is definitely still there on the extended information pages:
              Code:
              <div
              
              id="currentSection"
              
              >
              
              <a href="Optical_Illusions.html" class="product_section">
              Optical Illusions
              </a>
              </div>
              And this code should still work within the extended product pages.

              The only thing I can think of is that the styles for 'currentSection' are not included within the 'head' section of the extended info page. Could you check this please?

              (PS I 'm a big fan of your site, I've had that dragon illusion sat on my desk eyeballing me for the last week or so )

              Comment


                #8
                What do the coding errors say?

                Remember that these variables only work on Section Pages. You may want to consider a

                PageType == "Section"

                block around this code to protect it.

                Comment


                  #9
                  but that's going a bit OTT just to get around a coding error?
                  Not really. Your code includes a variable (MainSection::SectionName) that only works on section pages. You can also just surround the bit of code that does the change of formatting with the PageType blockif.

                  Comment

                  Working...
                  X