Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions

How to hide "Just those pages"..


Reply

4 Posts   581 Views

Avatar
wilsonStaff

8 December 2012 at 6:25am Community Member, 142 Posts

Hi, i have a menu that looks like this, typical SS3 menu:

<ul>
   <% loop Menu(1) %>
      <% if Children %>
         <li class="showSubMenu"><a href="#" title="$MenuTitle">$MenuTitle</a>
            <div class="outerSubMenu" id="$URLSegment">
               <ul>
                  <% loop Products %>
                     <li>
                        <div class="subMenu">
                           $IconeProduit.SetWidth(160)<br />
                           <a href="$Link" title="$Title">$Title</a>
                        </div>
                     </li>
                  <% end_loop %>
               </ul>
            </div>
         </li>
      <% else %>
         <li><a href="$Link" title="$MenuTitle">$MenuTitle</a></li>
      <% end_if %>
   <% end_loop %>
</ul>

It does what i want i.e.: shows div.submenus only if there are childs and

a href="#"

=> returns no links, only a clickable event

id="$URLSegment"

=> hides the submenus using CSS if needed

and there is no child, then there is

<li><a href="$Link" title="$MenuTitle">$MenuTitle</a></li>

Fine. But what if i want SOME CHILDREN NOT SHOW????

Using <% if PageType = ... %> ? => problem is that they are all same pagetype

Using <% if URLSegment = ... %> ? => dont want to mess with that (user can add child as needed)

Using <% if ChildrenOf(..) = ... %> => does that exist? If so, how to implement?

Thanks!

Avatar
Willr

8 December 2012 at 4:25pm Forum Moderator, 5511 Posts

Can you not just untick the 'Show In Menus' option in the CMS? This will hide the page from <% loop Children %> and any other feeds.

Avatar
wilsonStaff

8 December 2012 at 4:53pm Community Member, 142 Posts

nope i cant. because if i do, this:

<% loop ChildrenOf(the-page-i-dont-want-children-to-show)%>

wont return anything...

Avatar
kaanuni

20 December 2012 at 3:45am Community Member, 22 Posts

Well you can always create your own 'soft' don't show in menus custom field in your page model and then check it with an if block in the loop in your template .