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
Use note attribute to get another note's attribute (Read 4218 times)
Vlad Spears
Full Member
*
Offline



Posts: 2

Use note attribute to get another note's attribute
Jun 29th, 2012, 5:05pm
 
I've used Tinderbox for many writing purposes for years.  I'm in the process of returning to it from WordPress for my weblog.  Man, did I miss it.

I'm setting up HTML export templates now and just can't seem to get syntax correct for what seems like an easy problem.  I have a group of agents collecting individual notes based on a $Category attribute. Each category is exported as a single page of posts.  In the template post footer, I display the category a post belongs to.  This all works wonderfully.

I'd like the category listed in a post's footer to be a link to its category page.  This is where I think I must be missing something simple, either in implementation or in concept.

The $Category key attribute I enter for each note and the matching collecting agent might be named "Max/MSP", or "Unfälle", or "Life Extension".  Each of these agents has an $HTMLExportFileName value different than their name: MaxMSP, Unfalle, LifeExtension.

What I'm trying to do is use $Category for the note being exported to get the $HTMLExportFileName for its associated agent, then populate the template with that.  This would let me display the proper name for each category as the link a reader clicks, but put the actual exported filename for the category page in the link's URL.

I've tried a multitude of ways to do this, but can't get it to work.  For instance:

href="http//domain.com/category/^getFor($Category($HTMLExportFileName))^"

returns only this "href="http//domain.com/category/^getFor($Category($HTMLExportFileName))" as the actual export.

I know ^getFor is deprecated, so I've also tried various permutations using ^value.

I've also tried using ^url($Category) but this unexpectedly returns a strange concatenation of the above URL and the URL for this actual note being exported, not the one named by the value held in $Category.

I've dug around in the forum, the Cookbook and aTbRef, but no joy.  Perhaps I'm missing something to tell Tinderbox to treat the value held in $Category as a reference to an object or which converts it to a suitable format for that?
Back to top
 
« Last Edit: Jun 29th, 2012, 5:20pm by Vlad Spears »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Use note attribute to get another note's attribute
Reply #1 - Jun 29th, 2012, 8:01pm
 
It's late and pending a better look in the morning I think that for:

href="http//domain.com/category/^getFor($Category($HTMLExportFileName))^"

you mean to use:

href="http//domain.com/category/^value($HTMLExportFileName($Category))^"

...assuming $Category holds a single unique note name (or path)
Back to top
 
« Last Edit: Jun 29th, 2012, 8:02pm by Mark Anderson »  

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



Posts: 2

Re: Use note attribute to get another note's attribute
Reply #2 - Jun 29th, 2012, 10:48pm
 
Mark, thanks very much for your help.  You are a Tbx saint and I hope your sleep is currently sound.

I had earlier tried using ^value as you did above.  The result was only the first, static part of the URL without an exported filename: domain.com/category/

But confirmation from you this *should* work made me look deeper and I found the real problem!  To get things rolling I had dragged in some parts of a much earlier weblog structure I'd created back in the bad old days of Tinderbox 1.x.  The category agents display their names with a child count after them.  I had thought it was a display expression, but my earlier self had done this with a Rule:

Name=^Unfälle ^get(ChildCount)

So… the name of the agent wasn't "Unfälle". It was "Unfälle 9".  Ditch the rule, reset the agent name and bang! export using ^value works as it should.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print