Opened 9 years ago

Closed 9 years ago

#2790 closed defect (fixed)

titleindex change in behaviour following #1784

Reported by: jouvin@… Owned by: jouvin
Priority: normal Component: TocMacro
Severity: normal Keywords:
Cc: Odd Simon Simonsen Trac Release: 0.11



As the original author for titleindex feature in TOC, I don't like the change introduced in #1784 when no page is specified. In fact, it broke my sites...

Originally, the intent was to give an index of all the pages with the same parent as the page where titleindex is invoked. When you have site structured with several areas reflected in Wiki page names by one of several / in the page name, it was very handy as it was possible to just have the following very generic line to produce a title index of a specific wiki area :


No matter what is the name of the parent page. It seems this is no longer possible with the current implementation.

Would you agree on the principle to revert to previous behaviour with the following addition (I thought it was in the initial implementation) that a page ending with a / is interpreted as a parent and all the title of all the pages below is displayed instead of the matching page title and / as a special case to say all pages (like now with the empty page parameter).


Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by Odd Simon Simonsen

Trac Release: 0.100.11

I've been using the TOC macro since 0.9 myself, and back in 0.9 version titleindex worked like it now does again for 0.11 - a plain, non-restricted index of all pages. That changed for 0.10 where making such an index was actually impossible as there was no way to pick all pages. Our favorite trick was to do [[TOC(A,B,C,....,titleindex)]] and hope they all started with capital letters.... I ended up using my own custom version for 0.10 based off the 0.9 version.

Anyway, I do see the value of your proposal with page templates and the like - easily start pages like here on trac-hacks where each top-level page may be be a section of pages and without making any modifications to the macro to insert a specific ancestor page name. I'm not in favour of reverting to previous behavior for titleindex default page selection, but how about making an explicit [[TOC(sectionindex)]] argument instead? Without any page argument it will find the top-level ancestor and list all its decendants, and with page arguments it will find all decendants of those pages. How does that sound?

I'll happily apply such a patch if provided.

comment:2 Changed 9 years ago by jouvin@…

Your proposal is fine with me. That will requires some editing on my side/sites but nothing really critical anyway. I'll try to have a look at it when I have some spare time, but probably not before end of the week...


comment:3 Changed 9 years ago by jouvin@…

Owner: changed from Noah Kantrowitz to anonymous
Status: newassigned

In fact, it was a so easy and small change that I implemented it already. This is in r3417. I incremented version to (this is implemented only in the TocMacro for Trac v0.11). See documentation for more information about this option (sectionindex).

comment:4 Changed 9 years ago by Odd Simon Simonsen

Owner: changed from anonymous to jouvin
Status: assignednew

Ah. Of course. You already have commit permission. Looks good :-)

You may also want to add documentation of sectionindex in as well so that it shows up in the usual help page inside projects.

comment:5 Changed 9 years ago by jouvin@…

Resolution: fixed
Status: newclosed

Sorry for forgetting it in the first run. Done in r3418. I close the ticket, feel free to reopen it if something hurts.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain jouvin.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.