Announcement

Collapse
No announcement yet.

Subsection menu display

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

    Subsection menu display

    Hi Everyone,

    I need to display the subsections of the current top section in the menu and used the code as follows:



    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%27Section%27" >
    <actinic:block php="true">
    // Section page - remember current section info
    $thissectionid = '<actinic:variable name="SectionID" encoding="perl" selectable="false" />';
    $foundparent = false;
    </actinic:block>
    </actinic:block>

    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%21%3d%20%27Section%27" >
    <actinic:block php="true">
    // not on Section page - dummy section info
    $thissectionid = 'XXX';
    $foundparent = false;
    </actinic:block>
    </actinic:block>

    <actinic:block type="EntireSectionList">
    <actinic:block php="true">
    $menusectionid = '<actinic:variable name="SectionID" encoding="perl" selectable="false" />';
    $menusectionlevel = '<actinic:variable name="SectionLevel" encoding="perl" selectable="false" />';
    if ( $menusectionlevel == 1 )
    {
    // display top-level sections
    echo '<br/><actinic:variable name="SectionName" encoding="perl" selectable="false" />';
    }
    if ( $foundparent )
    {
    // sub-section of current section (or possibly we've done them all)
    if ( $menusectionlevel == 2 )
    {
    // woohoo child of current parent
    echo '<br/>--<actinic:variable name="SectionName" encoding="perl" selectable="false" />';
    }
    if ( $menusectionlevel == 1 )
    {
    // we must be back at a top-level section
    $foundparent = false;
    }
    }
    if ( ($thissectionid == $menusectionid) && ($menusectionlevel == 1) )
    {
    // we've just started on the current section
    $foundparent = true;
    }
    </actinic:block>
    </actinic:block>



    But the problem is that once I click on one of the subsection pages, the list of subsections disappear and only the main sections are displayed.

    I am not quite sure what I need to do with the second block:



    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%21%3d%20%27Section%27" >
    <actinic:block php="true">
    // not on Section page - dummy section info
    $thissectionid = 'XXX';
    $foundparent = false;
    </actinic:block>
    </actinic:block>



    What do I need to replace "xxx" with? And not quite sure about the "not on Section page - dummy section info" message.

    Any help would be appreciated.

    #2
    Originally posted by robertcs View Post
    Hi Everyone,

    I need to display the subsections of the current top section in the menu and used the code as follows:



    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%27Section%27" >
    <actinic:block php="true">
    // Section page - remember current section info
    $thissectionid = '<actinic:variable name="SectionID" encoding="perl" selectable="false" />';
    $foundparent = false;
    </actinic:block>
    </actinic:block>

    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%21%3d%20%27Section%27" >
    <actinic:block php="true">
    // not on Section page - dummy section info
    $thissectionid = 'XXX';
    $foundparent = false;
    </actinic:block>
    </actinic:block>

    <actinic:block type="EntireSectionList">
    <actinic:block php="true">
    $menusectionid = '<actinic:variable name="SectionID" encoding="perl" selectable="false" />';
    $menusectionlevel = '<actinic:variable name="SectionLevel" encoding="perl" selectable="false" />';
    if ( $menusectionlevel == 1 )
    {
    // display top-level sections
    echo '<br/><actinic:variable name="SectionName" encoding="perl" selectable="false" />';
    }
    if ( $foundparent )
    {
    // sub-section of current section (or possibly we've done them all)
    if ( $menusectionlevel == 2 )
    {
    // woohoo child of current parent
    echo '<br/>--<actinic:variable name="SectionName" encoding="perl" selectable="false" />';
    }
    if ( $menusectionlevel == 1 )
    {
    // we must be back at a top-level section
    $foundparent = false;
    }
    }
    if ( ($thissectionid == $menusectionid) && ($menusectionlevel == 1) )
    {
    // we've just started on the current section
    $foundparent = true;
    }
    </actinic:block>
    </actinic:block>



    But the problem is that once I click on one of the subsection pages, the list of subsections disappear and only the main sections are displayed.

    I am not quite sure what I need to do with the second block:



    <actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%21%3d%20%27Section%27" >
    <actinic:block php="true">
    // not on Section page - dummy section info
    $thissectionid = 'XXX';
    $foundparent = false;
    </actinic:block>
    </actinic:block>



    What do I need to replace "xxx" with? And not quite sure about the "not on Section page - dummy section info" message.

    Any help would be appreciated.
    I would suggest taking a look at the code that is freely available on the community to generate just what you are looking for.
    http://community.actinic.com/showthread.php?t=35767 I have used this with a variety of javascript and css to generate navigation for Actinic sites.

    Malcolm

    SellerDeck Accredited Partner,
    SellerDeck 2016 Extensions, and
    Custom Packages

    Comment


      #3
      Hi Malcolm,

      Thanks for your suggestion. It works really well.

      Cheers

      Robert

      Comment

      Working...
      X