Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Creating a tag list for blog navigation (Read 2364 times)
William Pickup
Full Member
*
Offline



Posts: 5
Sydney, Australia
Creating a tag list for blog navigation
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
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a tag list for blog navigation
Reply #1 - May 21st, 2015, 6:32pm
 
How about:

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

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
William Pickup
Full Member
*
Offline



Posts: 5
Sydney, Australia
Re: Creating a tag list for blog navigation
Reply #2 - 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
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a tag list for blog navigation
Reply #3 - 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).
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
William Pickup
Full Member
*
Offline



Posts: 5
Sydney, Australia
Re: Creating a tag list for blog navigation
Reply #4 - 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
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Creating a tag list for blog navigation
Reply #5 - May 22nd, 2015, 12:00pm
 
Happy to hear that.  Smiley
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print