Opened 7 years ago
Last modified 5 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)
Change History (8)
comment:2 by , 7 years ago
Replying to Ryan J Ollos:
Let's say you have a multi-level hierarchy with templates under
Machines/PageTemplates
but no templates underMachines/MachineGroup/PageTemplates
and you are creatingMachine/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 , 7 years ago
Milestone: | → next-dev-1.3.x |
---|
by , 7 years ago
Attachment: | T12900_page_templates.patch added |
---|
comment:5 by , 7 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.
comment:7 by , 5 years ago
Milestone: | next-dev-1.5.x → next-major-releases |
---|
Let's say you have a multi-level hierarchy with templates under
Machines/PageTemplates
but no templates underMachines/MachineGroup/PageTemplates
and you are creatingMachine/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.