Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS: MS XP Pro
Web Browser: IE
Categories: Search

-- JasonBenedict - 09 Apr 2006

Answer

ALERT! 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

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2006-04-18 - MichaelDaum
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.