Modify

Opened 10 years ago

Last modified 10 years ago

#12196 new enhancement

Indicate all active prefixes of current page (with PATCH)

Reported by: anonymous Owned by:
Priority: normal Component: TocMacro
Severity: normal Keywords:
Cc: a.degroot@… Trac Release: 1.0

Description

I have a wiki with a nested structure:

  • UserGuide
    • Topic1
    • Topic2
      • Details About Topic 2
  • SysadminGuide

On each page, I have multiple [[TOC]] macros: one listing the available guides, one listing the available topics, one listing details pages. The current implementation of [[TOC]] sets the CSS class active on the one single item that matches the current page name. In order to give a kind of "bread crumb" setup where you can see where in the hierarchy of pages you are, I have added an option allactive that marks those pages which have a pagename that is a prefix of the current page, as active as well. So when visiting details about topic 2, in the TOCs on that page, UserGuide and Topic2 and details about topic 2 are all marked active.

(I use TRAC 1.0, but I'm not really sure which version of the TOC macro my sources are based off of, since I originally imported a tarball into my own SVN)

Attachments (1)

allactive.patch (2.1 KB) - added by Adriaan de Groot 10 years ago.
Patch adding option allactive

Download all attachments as: .zip

Change History (3)

comment:1 Changed 10 years ago by Adriaan de Groot

An obvious extension of this scheme would be to allow different CSS classes on the different levels, to distinguish active-really-the-current-page from active-superpages-of-the-current-page, but that would require changes to multiple bits of code that assign a CSS class to an <ol> element within the macro.

Changed 10 years ago by Adriaan de Groot

Attachment: allactive.patch added

Patch adding option allactive

comment:2 Changed 10 years ago by Adriaan de Groot

My copy of the TocMacro sources says version = '11.0.0.3' so it is probably a pretty old version of the macro. I hope it still applies.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.