Skip to content

Instantly share code, notes, and snippets.

@bliswebagency
Created February 2, 2012 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bliswebagency/1720741 to your computer and use it in GitHub Desktop.
Save bliswebagency/1720741 to your computer and use it in GitHub Desktop.
Add Categories to Structure Navigation (#eecms)
{!-- MAKE SURE UNIQUE IDs = YES --}
{exp:structure:nav add_level_classes="yes" add_span="yes" add_unique_ids="yes" css_class="nav" css_id="nav_full" current_class="active" include_ul="yes" max_depth="5" mode="full" status="Open"}
{!-- This technique uses GWCODE Cats but you could do it the normal way --}
{!-- we're hiding the div that contains the stuff we want --}
<div style="display:none" id="prod_cats">
{!-- This technique uses GWCODE Cats but you could do it the normal way --}
{exp:gwcode_categories channel="products" incl_self="no" cat_id="70"}
{!-- The URIs are hard coded (with the exception of the cat id) --}
<a href="/site/cat_test/{cat_url_title}">{cat_name}</a>
{/exp:gwcode_categories}
</div>
{!-- IF YOU CHANGE ANY IDs, REFLECT THE CHANGES HERE --}
<script>
$(function(){
var stuff = $('#prod_cats').html();
$('#nav_full-applications').append(stuff)
});
</script>
@bliswebagency
Copy link
Author

FYI: You'll need JQuery to pull this off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment