Question
This is for my genealogy TWiki.
I'm trying to INCLUDE all the parent topics for the current topic, so if you can imagine being able to see your information but all of you ancestor's as well on one page.
So far I'm trying to merge the INCLUDE function and the code that produces the "You are here: ..." at the bottom of every page in the view.pattern.tmpl file. I've had very little success with the nesting of quotes, brackets and percent signs. Is there another way of doing this while editing a page rather than changing the template files?
Jason Benedict
http://www.Genealowiki.com
Environment
--
JasonBenedict - 09 Apr 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
this is not a direct answer to your question, but i suspect it will still be useful... have you seen
FamilyTreePlugin ?
--
WillNorris - 09 Apr 2006
To include all topic texts of all parents can be implemented using a recursive
TopicFunction
that takes as an argument the name of a topic to be displayed. After doing so it calls itself
again with the name of the parent topic but only if the current topic is not the
WebHome topic.
--
MichaelDaum - 09 Apr 2006
I have seen the
FamilyTreePlugin, and while it looks like quite the Plugin, it doesn't address what we're trying to accomplish.
The recursive
TopicFuction sounds intriguing, however, I'm at a loss as how to impliment it. I don't see it as a regular fuction so I take it that I would write it myself. If this is the case, I'm not sure where to start.
This is what I've come up with so far although I'd like to keep it out of the templates:
%INCLUDE{%META{\"parent\" nowebhome=\"on\" prefix=\"\" suffix=\"\" }%NOP%% }%
Thanks for your suggestions.
--
JasonBenedict - 09 Apr 2006
Jason, if there's something
FamilyTreePlugin doesn't do that you'd like it to do, then please feel free to improve it! The problems of including ancestor data
efficiently is one of the reasons I wrote it.
--
CrawfordCurrie - 10 Apr 2006
Here's your recursive
TopicFunction:
%STARTINCLUDE%
%INCLUDE{"%PARENT%" warn="off"}%
%INCLUDE{"%TOPIC%" PARENT="%SEARCH{"^%PARENT%$" scope="topic" regex="on" nonoise="on" format="$parent"}%" warn="off"}%
%STOPINCLUDE%
Save it in a topic of its own, e.g.
RenderRecursiveInclude. Call it using
%INCLUDE{"RenderRecursiveInclude" PARENT="TestTopic"}%
Where
TestTopic is the topic where you want to start to include up to its parent.
Sadly, you have to use %SEARCH{...}% instead of %META{"parent"}%. See
Bugs:Item2125
.
--
MichaelDaum - 18 Apr 2006