Paolo
Paolo

Reputation: 21056

Trac, wiki pages inheritance

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

Upvotes: 1

Views: 114

Answers (1)

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.

Upvotes: 3

Related Questions