Skip to content

Instantly share code, notes, and snippets.

@philcon93
Last active March 24, 2016 05:23
Show Gist options
  • Save philcon93/184e210a6698b44ac7e3 to your computer and use it in GitHub Desktop.
Save philcon93/184e210a6698b44ac7e3 to your computer and use it in GitHub Desktop.
Update Set Tag / Limit Menu Amount

Update Set Tag / Limit Menu Amount

B@se

Example - Make your content menu have a limit of 10 items in level 3

<!-- Make your content menu have a limit of (in this case) 10 items in level 3 -->
[%set [@level3_count@]%]0[%/set%]
[%content_menu content_type:'category' sortby:'sortorder' show_empty:'1'%]
[%param *level_3%]
[%if [@level3_count@] < 10%]
<li class="[%if [@next_level@]%]dropdown dropdown-hover[%/if%]"> <a href="[@url@]">[@name@] </a></li>
[%set [@^level3_count@]%]
[%calc [@level3_count@] + 1 /%]
[%/set%]
[%/if%]
[%/param%]
[%/ content_menu%]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment