PDA

View Full Version : Hiding subsections


dave_finlayson
23-Aug-2006, 08:39 PM
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

jont
23-Aug-2006, 09:05 PM
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 :)

NormanRouxel
23-Aug-2006, 09:07 PM
You can now easily have conditional code generation.

Have a look in the Actinic Help for "Creating a New Condition".

dave_finlayson
24-Aug-2006, 08:23 AM
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

dave_finlayson
25-Aug-2006, 01:35 PM
Any thoughts anyone?

cdicken
29-Aug-2006, 09:47 AM
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:
<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>

dave_finlayson
29-Aug-2006, 10:54 AM
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

dave_finlayson
29-Aug-2006, 11:32 AM
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>

cdicken
30-Aug-2006, 08:45 AM
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

dave_finlayson
11-Sep-2006, 08:26 PM
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

dave_finlayson
26-Sep-2006, 07:49 AM
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

cdicken
26-Sep-2006, 08:52 AM
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.

dave_finlayson
26-Sep-2006, 08:56 AM
No problem Chris, you can't have everything!

Thanks for looking.

David

dandelion
04-Oct-2006, 12:10 PM
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:

<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
---------------------------------

bentleybloke
31-Oct-2006, 01:42 PM
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!

cdicken
02-Nov-2006, 10:19 AM
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 :)

bentleybloke
02-Nov-2006, 11:48 AM
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?

cdicken
02-Nov-2006, 04:14 PM
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" />

remmo
25-Dec-2006, 10:50 AM
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.



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:
<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>

remmo
31-Dec-2006, 11:05 AM
Problem Resolved

pinbrook
31-Dec-2006, 11:11 AM
would you post your solution please, it will be useful for anyone else with the same issue

remmo
31-Dec-2006, 07:26 PM
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!

sally01
14-Feb-2007, 01:49 PM
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

Bruce
19-Feb-2007, 04:04 PM
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,

dandelion
02-Mar-2007, 06:22 PM
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:

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:

if section level == 2 AND (ListIndex-LastTopSectionListIndex) = 1

Many thanks, Dan

dandelion
05-Mar-2007, 04:59 PM
Does anybody have any thoughts on this one? Am still struggling to fix.

Many thanks, Dan

NormanRouxel
05-Mar-2007, 05:19 PM
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)

dandelion
06-Mar-2007, 10:05 AM
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 (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

cdicken
07-Mar-2007, 09:37 AM
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.

dandelion
07-Mar-2007, 10:12 AM
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

pinbrook
17-Jun-2007, 06:06 PM
if you post in error or decide your post is no longer relevant please use the delete post facility to get rid of it compleltey, this is a better solution than creating another post saying ignore.

when you've deleted your 2 posts i'll delete this one... :)

JSnow
11-Sep-2007, 01:51 PM
Don't mean to drag up a dinosaur here but someone needs to bring up her side of the bargain.

Clearly an "efficiency" issue here... developers :rolleyes:

jont
12-Sep-2007, 07:11 AM
Don't mean to drag up a dinosaur here but someone needs to bring up her side of the bargain.

Are you calling Jo a dinosaur? :eek: