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
Sets to HTML Links (Read 9599 times)
Craig Brown
Full Member
*
Offline



Posts: 4

Sets to HTML Links
Sep 25th, 2008, 10:54pm
 
Hello,
Is it possible to export a Set of Tags as separate links? eg Cats;Dogs;Fish, as links to separate pages!

Thanks in advance for any help!
Craig Brown
NZ
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Sets to HTML Links
Reply #1 - Sep 26th, 2008, 3:57am
 
Yes. Instead of looking for an 'export-set-as-list' command use the format action and a secondary attribute.  The process is described here. The slightly counter-intuitive leap is using a 'secondary' user attribute whose only purpose is to hold the output of format(). That 'extra' step can help keep the source set clean inside TB as well as not clutter your export code. It just seems odd creating an attribute for such a small task but don't worry as it won't impact TB performance.
Back to top
 
 

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



Posts: 4

Re: Sets to HTML Links
Reply #2 - Sep 26th, 2008, 4:58am
 
Thanks Mark,
Unfortunately your reply is way above my abilities with Tinderbox I'm not sure how to create a "attribute to hold the output of format()" I don't even know where to put the "format action" (an agent?) Sorry but my journey with Tinderbox has always been 2 steps forward and 1 step backwards!

Craig
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Sets to HTML Links
Reply #3 - Sep 26th, 2008, 7:39am
 
OK, no problem. I'd be tempered to suggest you spend a little time getting comfortable with basic HTML export first to help you understand the process. However, I know we all like to get to an outcome as soon as possible, so here's the outline:

1. How to make a new (user) attribute.
  • Choose menu: Window -> Attributes )or click Cmd+2). If not selected click the 'User' tab of the panel that opens.
  • Click 'Create' button.
  • Type a name for the attribute in the top ('name') box.  I suggested using 'FormattedList' as your name - you can read up on attribute naming later.
  • If the 'type' pop-up list says 'string' leave it, otherwise open the list and select that value.
  • Click the 'OK' button, your attribute is added and available for use.

    2. Using the format() action operation.  The term 'action' here means TB's internal scripting code and an 'operator' is TB's term for a predefined code command that does something for you (think method, function, etc.). We'll make an action in the form Attribute = format(Attribute,"<ul>","<li>","</li>","</ul>"). We'll do this via a rule so the action applies to the note running the rule. i'll assume for now your set attribute is called MySet. Here's the Rule code:

     FormattedList = format($MySet,"<ul>","<li>","</li>","</ul>")

    3. Using the list in export. Open your HTML template and where you want the list to appear add this:

     ^get(FormattedList)^

      ... or put the code actuall in the body copy of the note.

    ~~~

    If you give that a try and are struggling you'll probably want to take a little time getting used to actions & rules and HTML export before trying the technique. Good luck!

    [Post-edit] Oops, actually this will export the set values as an HTML list, and we'll need to consdier a different approach. See this thread.]
Back to top
 
« Last Edit: Sep 26th, 2008, 7:50am by Mark Anderson »  

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



Posts: 4

Re: Sets to HTML Links
Reply #4 - Sep 26th, 2008, 4:41pm
 
Thanks Mark,
I understand the basics quite well, HTML exporting etc is no problem It's the "coding" side of things thats quite hard for me.I basically learn by back engineering working examples, I really appreciate your help! if your ever in NZ I'll buy you a beer!

Cheers
Craig Brown
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Sets to HTML Links
Reply #5 - Sep 26th, 2008, 5:24pm
 
I may have a simpler route - not involving command line. Just passing a sample past Mark B.  If OK I'll post.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Sets to HTML Links
Reply #6 - Sep 28th, 2008, 8:54am
 
OK, here it is. Get the list_maker.tbx.zip from this page. The TBX should be fairly self explanatory.

Notes:
1. The technique assumes (and needs) that the set is holding actual note names.  If your desired source is a set based on some other attribute, make another user set attribute and use an action to make the latter hold the note name of all the notes in the former set.

2. Although initially I worked not allowing duplicate note names, if you enter paths where names might be duplicates the method seems to work.
Back to top
 
 

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



Posts: 4

Re: Sets to HTML Links
Reply #7 - Sep 29th, 2008, 3:44pm
 
Thanks Mark,
Have downloaded file and will have a good look at it as time allows.

Regards
Craig
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print