How to skip parents node in css list menu?

Hanh Dang asked on January 5, 2016 04:02

Hi all,

I have a documents tree which has some nodes are not shown in css list menu, but their child nodes are. So, can we skip parents node in css list menu. Example:

Documents tree:

Root

-- Node A

-- Node B

----- Node B1 (Skip this node)

-------- Node B11

-------- Node B12

----- Node B2 (Skip this node)

-------- Node B21

-------- Node B22

Css list menu should be:

-- Node A

-- Node B

----- Node B11

----- Node B12

----- Node B21

----- Node B22

Thank all!

Recent Answers


Brenden Kehren answered on January 5, 2016 04:36

I'd use a Universal Viewer vs. CSS List Menu, you have a lot more control. In this case, I believe you can check the hide in menu option in Properties>Navigation on the page and it should do the trick but not sure if it will allow the children to display.

0 votesVote for this answer Mark as a Correct answer

Hanh Dang answered on January 5, 2016 05:07

I have tried your way but no lucky. Once parents are not displayed, children are not.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on January 5, 2016 10:40 (last edited on January 5, 2016 10:43)

Hi,

what properties did you set on your Universal Viewer? Since Brendens Solution works for me.

Just set the Where condition to DocumentMenuItemHideInNavigation = 0

http://content.screencast.com/users/DavidTK/folders/Jing/media/de0b3d0a-25b8-428b-aa70-d7d27cfba6dc/2016-01-05_1038.png Image Text

Hope this helps.

Greets,

David

0 votesVote for this answer Mark as a Correct answer

Hanh Dang answered on January 11, 2016 09:08 (last edited on January 13, 2016 02:12)

Hi David,

Yes, The children could be displayed by using Universal Viewer. But how can I create a navigation bar with below format:

<ul>
    <li>Node A</li>    
    <li>Node B    
        <ul>        
            <li>Node B11</li>            
            <li>Node B12</li>                        
            <li>Node B21</li>
            <li>Node B22</li>            
        </ul>        
    </li>    
</ul>

I added a Header Transformation & Footer Transformation (or First Item Transformation & Last Item Transformation) into the Viewer but it render a incorrect format

<ul>
    <li>Node A</li>    
    <li>Node B</li>      
    <li>Node B11</li>            
    <li>Node B12</li>                        
    <li>Node B21</li>
    <li>Node B22</li>
</ul>

Item transformation

<li><%# Eval("NodeName") %></li>

Header Transformation

<ul>

Footer Transformation

</ul>

Child nodes were not displayed since using Hierarchical Transformation

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.