Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Creating a tag list for blog navigation
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1432246499

Message started by William Pickup on May 21st, 2015, 6:14pm

Title: Creating a tag list for blog navigation
Post by William Pickup on May 21st, 2015, 6:14pm

Hi,

In my Tinderbox blog I have agents for each tag and want to include a list of the tag names in a navigation sidebar. My problem is working out how to exclude the tag note that contains the agents from the list.

<h5>Tags</h5>
     <ul class="side-nav" role="navigation">
     ^include("/tags","/Templates/NavTemplate")^
</ul>

NavTemplate has the following

^if(ChildCount)^<li role="menuitem"><a href="^url()^">^title^</a></li>^children("/Templates/NavTemplate")^

This works however I get

tags
building
permaculture
etc..

What I am after is to leave out the "tags" note.

Any ideas ?

William

Title: Re: Creating a tag list for blog navigation
Post by Mark Anderson on May 21st, 2015, 6:32pm

How about:

^if($ChildCount & $Name!="tags")^<li role="menuitem"><a href="^url()^">^title^</a></li>^children("/Templates/NavTemplate")^^endIf^

Title: Re: Creating a tag list for blog navigation
Post by William Pickup on May 21st, 2015, 9:41pm

Thanks Mark, for answering my question and the many other contributions you make to the Tinderbox community.

When I add the additional check for the $Name, no HTML is emitted. I had the same result with other checks I tried such as using a specific prototype to identify these parent notes.

I am probably missing something basic. Is their more context I could provide that would help explain whats happening ?

WP

Title: Re: Creating a tag list for blog navigation
Post by Mark Anderson on May 22nd, 2015, 4:09am

Without seeing more of the document structure, it's hard to say. I'd assumed you where trying to filter out a note or agent with the $Name 'tags' but I suspect that may not be the case.

Have you tried simply setting that object not to export.  Select the note/agent in question and then open the HTML inspector and un-tick 'Export' and 'Export Children'. The export process ignores such notes; this is what the setting are for.  You generally only need a filter like above if the target object needs to export in some other context so you can't use these coarser Boolean export settings.

If the latter issue applieshere, make a new boolean such as $ExcludeThis and test for ($ChildCount & $ExcludeThis).

Title: Re: Creating a tag list for blog navigation
Post by William Pickup on May 22nd, 2015, 8:02am

Thanks  Mark for the pointers, the problem was with the location of the endif.

This code now does what I was after.

^if($ChildCount & $Name!="tags")^
<li role="menuitem"><a href="^url()^">^title^</a></li>^endIf^^children("/Templates/NavTemplate")^


WP

Title: Re: Creating a tag list for blog navigation
Post by Mark Anderson on May 22nd, 2015, 12:00pm

Happy to hear that.  :)

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.