How to automatically list child pages at top of wiki page?

319 views
Skip to first unread message

Craig A

unread,
Jun 15, 2011, 12:26:26 PM6/15/11
to Trac Users
The breadcrumbs that show wiki parent pages are great, but child pages
are hard to find. I would like to automatically show all child pages
at the top of each wiki page - effectively it would be the same result
as if I had manually typed [[TitleIndex(CurrentPage/)]] as the first
line of each wiki page.

It doesn't feel right to have to train every user "don't forget to
insert the TitleIndex macro at the top of every page that has child
pages, with a filter of the current pagename and a trailing slash". It
would be great to have this happen automatically but I am not sure
what is the best way to hook into Trac to make this happen. I thought
about site.html, but changes made there are not run through the wiki
processor. Is a plugin the best choice? Any nudges in the right
direction would be greatly appreciated.

Thanks
Craig

Helend

unread,
Jun 15, 2011, 10:17:22 PM6/15/11
to trac-...@googlegroups.com
Hi Craig,

I have the same question like you.

This question has been solved like this. TracWikiToolsPlugin, which developed by oforge, was used to define the relationship between wiki pages. I have created another plugin TracWikiMenu to show parent and children wiki pages just like the attached figure.

I didn't release this plugin as oforge website can not be accessed now. I can release my plugin if you like.

Helend

wikimenu.png

Cooke, Mark

unread,
Jun 16, 2011, 2:54:19 AM6/16/11
to trac-...@googlegroups.com
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of Craig A
> Sent: 15 June 2011 17:26
> To: Trac Users
> Subject: [Trac] How to automatically list child pages at top
> of wiki page?
>
> The breadcrumbs that show wiki parent pages are great, but child pages
> are hard to find. I would like to automatically show all child pages
> at the top of each wiki page - effectively it would be the same result
> as if I had manually typed [[TitleIndex(CurrentPage/)]] as the first
> line of each wiki page.

Not exactly what you want but you can create templates for new wiki
pages that could include boilerplate for this (and any other standard
page elements you want):

http://trac.edgewall.org/wiki/PageTemplates

~ mark c

Craig A

unread,
Jun 16, 2011, 2:35:04 PM6/16/11
to Trac Users
> I have created another plugin TracWikiMenu to show parent and children wiki
> I can release my plugin if you like.

Thanks Helend, I would be interested in the TracWikiMenu plugin. It
would be great if you could release it.

@Mark - thanks for the suggestion. Page templates is a good idea and
almost works. It only fails in one aspect - it requires users to do
something (select the template) so it is assured they won't do it in
most cases :)

Helend

unread,
Jun 17, 2011, 9:59:58 PM6/17/11
to Trac Users
Hi Craig,

Please find this plugin here: http://trac-hacks.org/wiki/TracWikiMenuPlugin

Helend
Reply all
Reply to author
Forward
0 new messages