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 >> Use note attribute to get another note's attribute
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1341003914

Message started by Vlad Spears on Jun 29th, 2012, 5:05pm

Title: Use note attribute to get another note's attribute
Post by Vlad Spears on 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?

Title: Re: Use note attribute to get another note's attribute
Post by Mark Anderson on 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)

Title: Re: Use note attribute to get another note's attribute
Post by Vlad Spears on 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.

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.