Announcement

Collapse
No announcement yet.

Hiding subsections

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

    Hiding subsections

    We currently use 3 different templates for navigation purposes, the layout changing as you move between main product sections.

    Just wondering if there is a way to now use just one layout and use variables to 'hide' the subsections that are not relevant the that particular part of the site. Currently the navigation is coded like this:-

    Outdoor Equipment
    • Breathable Waterproofs
    • Centre Waterproofs
    • Fleece & Basewear
    • etc etc

    Sports Equipment
    • Archery Equipment
    • Athletics Equipment
    • Badminton Equipment
    • etc etc

    Printing & Embroidery
    • T-Shirts
    • Polo Shirts
    • Sweatshirts
    • etc etc


    So, is it possible to have every section and subsection coded into the same layout, but hide, for instance, all the subsections within 'Sports Equipment' and 'Printing & Embroidery' whilst viewing any page within the 'Outdoor Equipment' section?

    David
    Cheers

    David
    Located in Edinburgh UK

    http://twitter.com/mcfinster

    #2
    Hi David,

    not got v8 on this machine at the moment so cant give the exact coding (or phraseology) required but you need to use the ListIndex variable as part of the blockif expression .... this allows you to mark the position in a list .. so if you only want to show the first section set the condition to =1 etc etc to show or hide the sections accordingly.

    Aplogies for the vagueness of the reply but I am sure you will soon see how it is done.

    The ListIndex is going to be a favourite of mine


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      You can now easily have conditional code generation.

      Have a look in the Actinic Help for "Creating a New Condition".
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Hmmm, can tried out ListIndex but seems to produce some strange results.

        My understanding would be that if I add a BlockIf statement around all the subsections in Outdoor Equipment, then set it to ListInder != 1 (greater than 1) then this should hide all subsections in Outdoor Equipment when browsing Sports Equipment or Printing and Embroidery. Similiarly if I then add a block on Sports Equipment for ListIndex 1 or 3 then this should hide the subsections here when viewing the other sections. Is this right? I does not seem to work for me

        Dave
        Cheers

        David
        Located in Edinburgh UK

        http://twitter.com/mcfinster

        Comment


          #5
          Any thoughts anyone?
          Cheers

          David
          Located in Edinburgh UK

          http://twitter.com/mcfinster

          Comment


            #6
            OK - here's a solution.

            First of all you need to create a new variable called 'SectionNumber'. Make sure the place of setting is 'Section' and that 'Use Parent' is an option in the list.

            Now set a value for 'SectionNumber' of '1' within the 'Outdoor Equipment' section, '2' within the 'Sports Equipment' section etc. Make sure that the sub-sections are inheriting this value (i.e. the 'SectionNumber' field is set to 'Use Parent').

            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


              #7
              Chris,

              Thanks for that, never quite worked as I wanted it to but got it wokring perfectly with this code (for anyone else who might want to do it)

              <div id="contentleft">
              <div id="leftnavlinks">
              <A href="Outdoor_Equipment.html" class="outdoorheaderlink">Outdoor Equipment </A>
              <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%201">
              <A href="Breathable_Waterproofs.html">Breathable Waterproofs </A>
              <A href="Centre_Waterproofs.html">Centre Waterproofs </A>
              <A href="Fleece_Base_Wear.html">Fleece &amp; Base Wear </A>
              </actinic:block>
              <A href="Sports_Equipment.html" class="sportsheaderlink">Sports Equipment /A>
              <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%202"
              <A href="Archery.html">Archery Shop </A>
              <A href="Athletics.html">Athletics Shop </A>
              <A href="Badminton.html">Badminton Shop </A>
              <A href="Basketball.html">Basketball Shop </A>
              </actinic:block>
              <A href="Printing_Embroidery.html" class="uniformheaderlink">Printing &amp; Embroidery </A>
              <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%203"> <A href="Printed_Embroidered_T_Shirts.html">T-Shirts </A>
              <A href="Printed_Embroidered_Polo_Shirts.html">Polo Shirts </A>
              <A href="Printed_Embroidered_Sweatshirts.html">Sweatshirts </A>
              </actinic:block>

              Thanks again!

              Dave
              Cheers

              David
              Located in Edinburgh UK

              http://twitter.com/mcfinster

              Comment


                #8
                Ok, heres the final code I actually ended up with. Works brilliantly but have a couple of questions:-

                1. Can you now use the same layout for brochure pages? And if so, how can you show one of the sections by default?
                2. Similiarly, as a trial I applied the layout to the checkout pages. Correctly, it now just shows the links to the sections and not any of the subsections. Is it possible to show a 'default' section here (in our case we would want to show the Outdoor section in both the brochure and checkout)?

                Would be wonderful if it could be done, and finally reduce a site that currently uses 6 Primary Templates for v7 (pain to manage) to just one for v8.

                Dave
                (Code below)

                <div id="contentleft">
                <div id="leftnavlinks">
                <A href="Outdoor_Equipment.html" class="outdoorheaderlink">Outdoor Equipment </A>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%201" >
                <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="%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" >
                </actinic:block>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202">
                <a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a>
                </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" >

                </actinic:block>

                </actinic:block>

                </actinic:block></actinic:block>
                <A href="Sports_Equipment.html" class="sportsheaderlink">Sports Equipment </A>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%202" >
                <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="%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" >
                </actinic:block>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202">
                <a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a>
                </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" >

                </actinic:block>

                </actinic:block>

                </actinic:block></actinic:block>
                <A href="Printing_Embroidery.html" class="uniformheaderlink">Printing &amp; Embroidery </A>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%3d%3d%203">
                <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="%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" >
                </actinic:block>
                <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%202">
                <a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a>
                </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" >

                </actinic:block>

                </actinic:block>

                </actinic:block></actinic:block>
                Cheers

                David
                Located in Edinburgh UK

                http://twitter.com/mcfinster

                Comment


                  #9
                  1. Can you now use the same layout for brochure pages? And if so, how can you show one of the sections by default?

                  2. Similiarly, as a trial I applied the layout to the checkout pages. Correctly, it now just shows the links to the sections and not any of the subsections. Is it possible to show a 'default' section here (in our case we would want to show the Outdoor section in both the brochure and checkout)?
                  I suggest you make use of the 'PageType' variable. So you design the content you want to just appear in the brochure pages and surround it with the following condition:

                  <actinic:variable name="PageType" /> == 'Brochure'

                  Then include the stuff you want to appear on the checkout pages and surround it with the following condition:

                  (<actinic:variable name="PageType" /> == 'Checkout Page 0') OR (<actinic:variable name="PageType" /> == 'Checkout Page 1') OR (<actinic:variable name="PageType" /> == 'Checkout Page 2') OR (<actinic:variable name="PageType" /> == 'Checkout Page 3') OR (<actinic:variable name="PageType" /> == 'Receipt') OR (<actinic:variable name="PageType" /> == 'PSP Bounce Page') OR (<actinic:variable name="PageType" /> == 'Signature')

                  Instructions for using the same overall layout for brochure pages and section pages are in http://community.actinic.com/showthread.php?t=23085

                  Comment


                    #10
                    Chris,

                    Thanks for that, back from holiday and it seems to work BUT only if I can display section links within brochure and checkout pages. Is this possible? Ideally using SectionPageName and SectionNumber as above!

                    Cheers

                    David
                    Cheers

                    David
                    Located in Edinburgh UK

                    http://twitter.com/mcfinster

                    Comment


                      #11
                      Anyone any thoughts on this? Has anyone managed to get a use EntireSectionList within Brochure pages but restrict the sections it spews out based on variables?

                      Cheers

                      David
                      Cheers

                      David
                      Located in Edinburgh UK

                      http://twitter.com/mcfinster

                      Comment


                        #12
                        Well, you can create variables and make them settable for brochure pages - but you won't have this option for the cart/checkout pages.

                        I think you will have to hard-code the section links you want to appear on all cart/checkout pages - and then use the condition I showed you to hide the hard-coded content from all section/brochure pages.

                        Comment


                          #13
                          No problem Chris, you can't have everything!

                          Thanks for looking.

                          David
                          Cheers

                          David
                          Located in Edinburgh UK

                          http://twitter.com/mcfinster

                          Comment


                            #14
                            Have done a similar thing but included top level section links to non-current sections as well, via the 5 lines above the bottom closing block:

                            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 /><a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a>
                                        </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 if="%3cactinic%3avariable%20name%3d%22SectionNumber%22%20%2f%3e%20%21%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 /><a href="<actinic:variable name="SectionPageName"/>" target="_self"><actinic:variable name='SectionName'/></a>
                                        </actinic:block>         
                                      </actinic:block>
                                    </actinic:block>
                            This gives, if you're on a section 1 page:
                            -----
                            Section 1
                            • subsection a
                            • subsection b
                            • subsection c

                            Section 2
                            Section 3
                            Section 4
                            ---------------------------------
                            Or, if you're on a section 3 page:
                            -----
                            Section 1
                            Section 2
                            Section 3
                            • subsection a
                            • subsection b
                            • subsection c

                            Section 4
                            ---------------------------------
                            adaptive-image.co.uk

                            Comment


                              #15
                              I've been playing with the code above and been messing around with some css styling. I'd like to highlight the current subsection in the menu.

                              Any ideas? I've been messing around with conditions for ages and can get everything but this to happen!

                              Thanks!

                              Comment

                              Working...
                              X