1

I'm managing a project using trac. I have structured pages hierarchically and they look as this excerpt from TitleIndex shows:

0.9
  0.9 (this is a page)
  Xyz
    0.9/XyzFaq          (this is a page)
    0.9/XyzReleaseNotes (this is a page)
    0.9/XyzRoadmap      (this is a page)

The page called 0.9 contains this markup:

= Xyz version 0.9 main page =

Status: DEVELOPMENT

[[TitleIndex(0.9)]]

I'd like that subpages would inherit project development status from their parent. Is there a way to do this?

Thanks

Community
  • 1
  • 1
Paolo
  • 20,112
  • 21
  • 72
  • 113

1 Answers1

3

This is quite easy to do with the macro system. If you want a ready-made macro, look at IncludeMacro, which would work like:

  1. In a wiki page called Status/0.9 have just the text DEVELOPMENT
  2. In all pages below 0.9/ have a line Status: [[Include(Status/0.9)]]

If this is cumbersome, writing your own macro is quite simple. Basically just get the parent wiki page name from current page name with simple string processing, then open the wiki page and search for the Status: line with a regex.

  • Thanks for this solution, using regex is cool. Though for my simple case I just ended to use PageTemplates. That was very easy too. – Paolo May 09 '11 at 21:57
  • Your approach is much more flexible if the inherited text changes often. Using PageTemplates the change doesn't automatically reflect on child pages (at least I think so). – Paolo May 09 '11 at 22:08
  • @Guandalino: Yes, PageTemplates just define the initial, static content for the page. – StackExchange saddens dancek May 10 '11 at 10:29