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
Agents, aliases and referencing the original note (Read 4349 times)
David L-R
Full Member
*
Offline



Posts: 19

Agents, aliases and referencing the original note
Mar 29th, 2010, 6:26pm
 
I have a horrible feeling that this is something very basic - so apologies in advance.  I have  a couple of agents that are collecting notes using attributes tasked and owner - to identify activities within a project.  I am exporting the notes with a template that uses ^ancestors and ^childlinks to build pages that navigate up and down through the notes.  How can I refer to the original notes when building pages from the agents.  The links, understandably, work to the children and ancestor of the agents.    Thanks!
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agents, aliases and referencing the original note
Reply #1 - Mar 29th, 2010, 7:15pm
 
For an alias, $Attrib(this) refers to the alias's properties and $Attrib(original) refers to the original note.  Usually, these are the same.
Back to top
 
 
WWW   IP Logged
David L-R
Full Member
*
Offline



Posts: 19

Re: Agents, aliases and referencing the original note
Reply #2 - Mar 30th, 2010, 2:13am
 
Mark

Thanks.  I am sorry but I must be missing something.  I cannot see what to put into the html template of the agent to be able to list its children but with links to the original note.  For example, I have an agent that contains aliases of notes for a particular individual who is tasked, $Tasked=Name.  I am trying to use that agent to build a page of those tasks but with links to the original notes.  I have been using ^childLinks, and of course these refer to the links of the aliases relative to the agent.  I cannot see how to add (original) to this so that it can pick up the link to the original. I cannot see what other attribute I can use, or how to find this.  I am sure that there is something really obvious here, but I am missing it.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents, aliases and referencing the original note
Reply #3 - Mar 30th, 2010, 3:44am
 
Aliases export as their own pages, which is necessary when trying to use hierarchical nav so you end up where you would in the hierarchy when following links. Your scenario needs to to work around this concept as you don't want to link to the hierarchical location (children of the agent) but to some other notes that happen to be the originals of the agent's aliases.

For the latter reason, do not use childLinks as they work on the hierarchical model. Instead you want use linkTo(original) for each alias in the agent, so a different approach is needed (notes on linkTo).

The trick is to use a variant of the envelope-letter approach. Here we're not worried about recursing down the descendants as agents only ever have children, but we want to export linkTo(original) in the content of each alias.

Template for aliases. Make a template note called LinkToOriginals. Add this code:
Code:
<li>^linkTo(original)^</li>
 


N.B. add a line return after the </li>.

Template for the agent. Make a template note called AgentExport. Make code like so:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>^title^</title>
</head>
<body>
<ul>
^children("/Templates/LinkToOriginals")^</ul>
</body>
</html> 


N.B. the exact path to your template will depend on where you've stored your template notes. The above example assumes you've made a root-level note for templates called "Templates" and put all your HTML templates there.

The HTML page exported by the agent will now have a bulleted list of links each of which will link to the original note of the agent's child alias.

In summary, because you're trying to work outside the hierarchical export context in making your links, you need to take an alternate approach to how you export the agent. You can still export content from the agent, e.g. insert ^text^ above or below the <ul></ul> section in the template. Want more child content? Put more export code inside the <li></li> sections.
Back to top
 
 

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



Posts: 19

Re: Agents, aliases and referencing the original note
Reply #4 - Mar 30th, 2010, 8:42am
 
Mark

You are a star!  Thank you.  This works perfectly.  I am really enjoying getting into Tinderbox...
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print