Announcement

Collapse
No announcement yet.

Hiding subsections

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

    #16
    Use the following expression within some 'block if' tags that surround the code you are using to do the highlighting...

    <actinic:variable name="SectionID" /> == <actinic:variable name="MainSection::SectionID" />
    This will validate to 'true' if the ID of the section in the section link is the same as the ID of the current section.

    I love conditions

    Comment


      #17
      Thank you very much, just the job.

      I agree the conditions are genius, so long as you know what to put in them!

      Is there a way to keep the highlighted code highlighted when in a subsection beneath it?

      i.e.

      Section 1
      • subsection a
      • subsection b
      • subsection c

      Section 2
      Section 3
      Section 4

      Subsection a also has its own subsections, which isn't shown in the sidebar menu. Is there a way to keep subsection a highlighted in the sidebar when you are in one of its child sections?

      Comment


        #18
        The way to do this woud be to use a custom variable rather than SectionID. Create a new variable called something like 'SectionNumber' and then make it settable at the 'Section' level. Make sure 'Use Parent' is set as the 'Initial Value' for the setting for this variable.

        You can then set a value for 'SectionNumber' in the 'Properties' tab of the main Section and then this value will be inherited by all the subsections.

        The condition would then be something like

        <actinic:variable name="SectionNumber" /> == <actinic:variable name="MainSection::SectionNumber" />

        Comment


          #19
          Where exactly in the Main Product Area do we need to add this code. I keep getting very strange results... has me thinking I'm putting it in the wrong spot. Sorry probably a real simple question.

          Originally posted by cdicken

          Now copy and paste the following code within the 'Main Product Area' layout - this will be a layout called something like 'Section Page With Section Name At The Top'. Copy and paste the following code into the top of the layout:
          Code:
          <actinic:block type="EntireSectionList">
          
          <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" >
          
          <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%201" >
          	<br /><strong><a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a></strong>
          </actinic:block>
          
          <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202%29%20AND%20%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201%29" >
          	<ul>
          </actinic:block>
          <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202">
          	<li><a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a></li>
          </actinic:block>
          <actinic:block if="%28%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202%29%20AND%20%28%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%20%3cactinic%3avariable%20name%3d%22ListCount%22%20%2f%3e%29" >
          	</ul>
          </actinic:block>
          
          </actinic:block>
          
          </actinic:block>

          Comment


            #20
            Problem Resolved

            Comment


              #21
              would you post your solution please, it will be useful for anyone else with the same issue

              Comment


                #22
                Sorry Jo, I'm not 100% sure on what I've done to fix the problem... But I think that I had a space in between the two words of the variable "SectionNumber" instead of joining the two words together.

                Not sure if that was the solution though but it seems to work now.

                Happy New Year!

                Comment


                  #23
                  Hi,

                  I'm trying to do something pretty much as Dandelion describes in this thread.

                  Everything is looking pretty good except that the navigation is repeated 9 times which is the same number of top level sections I have.

                  Anyone have any ideas what I'm doing wrong.

                  Regards
                  Sally
                  Regards
                  Sally

                  Fashion Jewellery Wholesale - Glitzy Jewels

                  Comment


                    #24
                    Sally,

                    Please post the code you are using and tell us where and how you are using it so that we can tell you whats happening. Is there a URL at which a check can be done?

                    Kind regards,
                    Bruce King
                    SellerDeck

                    Comment


                      #25
                      Have just revisited this in v8.5, and it appears that ListIndex is now 'per catalogue' rather than per section, i.e my first subsection under the second top level section, now has ListIndex = 3 - so the conditional:

                      Code:
                      if section level == 2 AND ListIndex = 1
                      ...no longer works. Am I right in thinking that ListIndex has changed in this way?

                      If so, is there a mechanism to allow the set up of a variable in the EntireSectionList loop, and write the previous top level section's ListIndex into it, then modify the above to:

                      Code:
                      if section level == 2 AND (ListIndex-LastTopSectionListIndex) = 1
                      Many thanks, Dan
                      adaptive-image.co.uk

                      Comment


                        #26
                        Does anybody have any thoughts on this one? Am still struggling to fix.

                        Many thanks, Dan
                        adaptive-image.co.uk

                        Comment


                          #27
                          Dan. Typo there

                          if section level == 2 AND ListIndex = 1

                          should be

                          if section level == 2 AND ListIndex == 1

                          You're inadvertantly setting ListIndex to 1.

                          I also tend to bracket everything for clarity - e.g.

                          if (section level == 2) AND (ListIndex == 1)
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #28
                            Thanks Norman, but the typo was in my post, rather than in the code.

                            Still stumped.

                            Code is attached as text file if anyone has the time to look. I have appended the SectionLevel, and ListIndex vars to test.

                            My problem is that the second level <ul> is not opening, so although the data is good, the CSS formatting of the subsection list is not there. Originally this code has the subsections as a list, but the main sections as <br /> separated lines, so maybe this has always been the case.

                            test page at: [http://85.92.67.13/~scrumpym/acatalog/Clothing.html
                            Shoes, 2, 3 and 4 should be styled differently, but are not as ListIndex for these starts at 3, not 1.

                            Thanks for looking, Dan
                            Attached Files
                            adaptive-image.co.uk

                            Comment


                              #29
                              Sorry Dan, but if you are using the 'EntireSectionList' list then the list index is not set within each section. The list index is for each item within the list. It's always worked like this.

                              What could could do is have each bullet as it's own <ul> list (within only one item within each list) and then use CSS formatting to reduce the margin/padding between each list so it will just look like a single list.

                              You can then use conditions to change the formatting of any <ul> list that belongs to a section with a SectionLevel of 2 to indent it more etc.

                              Comment


                                #30
                                Thanks Chris, I thought that might be the case. I think that I will open a single list that covers both SectionLevel 1 and SectionLevel 2, and I can then style the <li>'s individually.

                                Thanks again, Dan
                                adaptive-image.co.uk

                                Comment

                                Working...
                                X