Edgewall Software
Modify

Opened 4 years ago

Last modified 2 years ago

#12900 new enhancement

Hierarchy-specific PageTemplates

Reported by: anonymous Owned by:
Priority: normal Milestone: next-major-releases
Component: wiki system Version:
Severity: normal Keywords: PageTemplates
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The PageTemplates feature uses:

wiki pages having a name starting with PageTemplates/

as templates.

And the default selection:

will be blank page, or DefaultPage if PageTemplates/DefaultPage exists.

What's missing are templates that are only relevant to certain page hierarchy path prefixes, and a default template for those. For example when creating the page wiki:Machines/NewMachine the templates under wiki:Machines/PageTemplates should also be available. and wiki:Machines/PageTemplates/DefaultPage (or at least wiki:PageTemplates/Machines/DefaultPage) should be the default.

Attachments (1)

T12900_page_templates.patch (5.8 KB ) - added by anonymous 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Ryan J Ollos, 4 years ago

Let's say you have a multi-level hierarchy with templates under Machines/PageTemplates but no templates under Machines/MachineGroup/PageTemplates and you are creating Machine/MachineGroup/NewMachine. Should the list of templates from the parent page (Machines/PageTemplates) be shown?

I don't think there's a good general answer to that question. I can also think of other patterns that might be useful, like customizing the templates based on the permission group that a user is a member of. What we might be able to do is provide an extension point for customizing the page templates.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

in reply to:  1 comment:2 by anonymous, 4 years ago

Replying to Ryan J Ollos:

Let's say you have a multi-level hierarchy with templates under Machines/PageTemplates but no templates under Machines/MachineGroup/PageTemplates and you are creating Machine/MachineGroup/NewMachine. Should the list of templates from the parent page (Machines/PageTemplates) be shown?

I would say ideally yes, but not showing it would also be acceptable.

I don't think there's a good general answer to that question. I can also think of other patterns that might be useful, like customizing the templates based on the permission group that a user is a member of. What we might be able to do is provide an extension point for customizing the page templates.

That also sounds good I think.

comment:3 by Ryan J Ollos, 4 years ago

Milestone: next-dev-1.3.x

by anonymous, 4 years ago

Attachment: T12900_page_templates.patch added

comment:4 by anonymous, 4 years ago

I'm actually not sure if it's worth it.

comment:5 by Ryan J Ollos, 4 years ago

Yeah, I started working on a patch somewhat similar to yours and also started questioning the complexity.

It might make sense to implement the original suggestion, with the following behavior: From a child page, search up the hierarchy and check each parent for a PageTemplates sibling. So page /A/B/C would use page templates from /A/B/PageTemplates, if it exists, otherwise /A/PageTemplates, otherwise /PageTemplates.

I would first extract get_templates_names and get_page_template methods on the class, before adding the additional complexity. I think the code will be more clear and it will be easier to test. If you create the patch and there are no objects from other developers I will make sure it lands in Trac 1.4.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

comment:6 by Ryan J Ollos, 2 years ago

Milestone: next-dev-1.3.xnext-dev-1.5.x

Milestone renamed

comment:7 by Ryan J Ollos, 2 years ago

Milestone: next-dev-1.5.xnext-major-releases

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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