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
Not exporting the children of an alias? (Read 3370 times)
Rónán Kennedy
Full Member
*
Offline



Posts: 26

Not exporting the children of an alias?
Oct 24th, 2010, 6:00am
 
I seem to be having the opposite problem to Sebastian (http://www.eastgate.com/Tinderbox/forum//YaBB.pl?num=1283615992). I have an agent that collects some notes. I want to export just those notes. To avoid duplication, I am using an export template that I use to export all of the notes, which finishes with

Code:
^children^ 



in order to traverse the tree of notes.

If I understand correctly, aliases collected by an agent don't have children. However, the template seems to be ^including the children of the "real" note, which I don't want. Is there a way to work around this, or am I doing something wrong?

(I know I could simply have two versions of the export template, one that collects children and one that doesn't, but it's easier to maintain just one set.)
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Not exporting the children of an alias?
Reply #1 - Oct 24th, 2010, 7:49am
 
You are correct that an alias - as seen in situ in a view (map, outline, etc.) - doesn't have children.  But, its original may have and that is what ^children^ will look at.

Here's some code to use that will test if the item being exported is the child of an agent:
Code:
^if($AgentQuery(parent)!="")^
^title^ is in an agent^
^else^
^title^ is in a container
^endIf^ 

BTW, don't try checking the short form of the query as in ^if($AgentQuery(parent)^ such as you might in action code - it doesn't give the same result.

Back to top
 
 

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



Posts: 26

Re: Not exporting the children of an alias?
Reply #2 - Oct 24th, 2010, 8:00am
 
Thanks for the code. This will export the children of a container but not of an alias:

Code:
^if($AgentQuery(parent)=="")^ ^children^ ^endIf^
 

Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print