Edgewall Software
Modify

Opened 4 years ago

Closed 3 years ago

Last modified 2 years ago

#12265 closed enhancement (fixed)

Permit arbitrary absolute wiki page names in wiki edit template= argument

Reported by: trachacks@… Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.2
Component: wiki system Version:
Severity: normal Keywords: PageTemplates
Cc: Branch:
Release Notes:

Absolute path to wiki page can be passed in the template argument by prefixing path with / (e.g. /TheTemplate). This is useful for plugins and links that wish to use a template that shouldn't be visible in the templates dropdown of the wiki new page form. Relative paths are still prefixed with PageTemplates/.

API Changes:

Description

Attached is a small enhancement to trac core wiki/web_ui.py. Please consider including this patch in a future version of trac.

When editing a new wiki page, it is possible to select from template pages placed under PageTemplates/, and it is possible to pass a template= argument directly along with an edit link to select the specific template to use.

I came across this feature recently when reviewing the trachacks:wiki/WikiCalendarMacro which has a base=template parameter to select the template to use when creating a new calendar subpage. For this use case, it is not really useful to be forced to place the template under PageTemplates/ where it will _also_ be visible in the new wiki page template dropdown box; these kinds of templates are only useful for the specific calendar.

To this end, I came up with this enhancement patch. If the template argument starts with a slash, e.g. template=/some/template, that absolute path is directly used as the source page, omitting the PageTemplate/ prefix that is otherwise hardcoded.

NOTE: patch is against trac 0.11.7 as that's what I'm still using. I had a look at the code in current trunk - it's unchanged, so the patch should apply with some offset.

Attachments (1)

trac-absolutetemplate.patch (907 bytes ) - added by trachacks@… 4 years ago.

Download all attachments as: .zip

Change History (6)

by trachacks@…, 4 years ago

Attachment: trac-absolutetemplate.patch added

comment:1 by Ryan J Ollos, 3 years ago

Milestone: 1.3.1
Owner: set to Ryan J Ollos
Status: newassigned

Sorry for the long delay in reviewing the patch. I'll look at it for milestone:1.3.1.

comment:2 by Christian Boos, 3 years ago

Milestone: 1.3.1next-dev-1.3.x

Moving to some later 1.3.x version.

comment:3 by Ryan J Ollos, 3 years ago

Milestone: next-dev-1.3.x1.3.2
Release Notes: modified (diff)

Proposed changes in [3e7d2bc7/rjollos.git].

comment:4 by Ryan J Ollos, 3 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in r15764.

comment:5 by anonymous, 2 years ago

Keywords: PageTemplates added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.