hi community
firstly, apologies for long windedness of this post, any help/pointers greatly appreciated.
i'm trying to create a sub-navigation that displays only the sub-sections for the currently chosen section. i have hacked together some code from other examples found but i'm unsure how to access the current section?
i've created a 'parentsection' variable that allows me to associate a sub-section to it's parent but am unsure how to 'say'
if parentsection == currentlychosensection then
display this sub-section
also my parentsection var makes use of 'use parent' within the sub-section pages and i don't know how to access a variable value when it's set to this?
current code is this
<ul class="list-subnav">
<!-- entire section list -->
<!--
whats going on
if current section level is > previous section level and current section level == 2
create a new ul of subnav-sub-category
if current section level is > previous section level and current section level == 3
create a new ul of subnav-sub-sub-category
if current section level < previous section level
close the ul
if current section level < previous section level and current section level == 1
(we're closing a level 3 down to the base level)
so close the li / ul / li
if current section level is == previous section level OR current section level is < previous section level
close the li
always start an li
save the current section level
-->
<actinic:block type="EntireSectionList" >
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" > $previousSectionLevel) && ("<actinic:variable name="SectionLevel" />" == 2))
echo "<ul class='list-subnav-sub-category'>";
</actinic:block>
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" > $previousSectionLevel) && ("<actinic:variable name="SectionLevel" />" == 3))
echo "<ul class='list-subnav-sub-sub-category'>";
</actinic:block>
<actinic:block php="true" >
if ("<actinic:variable name="SectionLevel" />" < $previousSectionLevel)
echo "</ul>";
</actinic:block>
<actinic:block php="true" >
if ("<actinic:variable name="SectionLevel" />" < $previousSectionLevel && "<actinic:variable name="SectionLevel" />" == 1)
echo "</li></ul></li>";
</actinic:block>
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" == $previousSectionLevel || "<actinic:variable name="SectionLevel" />" < $previousSectionLevel))
echo "</li>";
</actinic:block>
<li><a href="<actinic:variable name="SectionPageName"/>" <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" >class="selected"</actinic:block>><actinic:variable name='SectionName'/></a>
<actinic:block php="true" >
$previousSectionLevel = "<actinic:variable name="SectionLevel" />";
</actinic:block>
</actinic:block>
</ul>
firstly, apologies for long windedness of this post, any help/pointers greatly appreciated.
i'm trying to create a sub-navigation that displays only the sub-sections for the currently chosen section. i have hacked together some code from other examples found but i'm unsure how to access the current section?
i've created a 'parentsection' variable that allows me to associate a sub-section to it's parent but am unsure how to 'say'
if parentsection == currentlychosensection then
display this sub-section
also my parentsection var makes use of 'use parent' within the sub-section pages and i don't know how to access a variable value when it's set to this?
current code is this
<ul class="list-subnav">
<!-- entire section list -->
<!--
whats going on
if current section level is > previous section level and current section level == 2
create a new ul of subnav-sub-category
if current section level is > previous section level and current section level == 3
create a new ul of subnav-sub-sub-category
if current section level < previous section level
close the ul
if current section level < previous section level and current section level == 1
(we're closing a level 3 down to the base level)
so close the li / ul / li
if current section level is == previous section level OR current section level is < previous section level
close the li
always start an li
save the current section level
-->
<actinic:block type="EntireSectionList" >
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" > $previousSectionLevel) && ("<actinic:variable name="SectionLevel" />" == 2))
echo "<ul class='list-subnav-sub-category'>";
</actinic:block>
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" > $previousSectionLevel) && ("<actinic:variable name="SectionLevel" />" == 3))
echo "<ul class='list-subnav-sub-sub-category'>";
</actinic:block>
<actinic:block php="true" >
if ("<actinic:variable name="SectionLevel" />" < $previousSectionLevel)
echo "</ul>";
</actinic:block>
<actinic:block php="true" >
if ("<actinic:variable name="SectionLevel" />" < $previousSectionLevel && "<actinic:variable name="SectionLevel" />" == 1)
echo "</li></ul></li>";
</actinic:block>
<actinic:block php="true" >
if (("<actinic:variable name="SectionLevel" />" == $previousSectionLevel || "<actinic:variable name="SectionLevel" />" < $previousSectionLevel))
echo "</li>";
</actinic:block>
<li><a href="<actinic:variable name="SectionPageName"/>" <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" >class="selected"</actinic:block>><actinic:variable name='SectionName'/></a>
<actinic:block php="true" >
$previousSectionLevel = "<actinic:variable name="SectionLevel" />";
</actinic:block>
</actinic:block>
</ul>
Comment