Ticket #1376 (new enhancement)
Opened 7 years ago
Last modified 2 years ago
Alternate Template for wiki pages
| Reported by: | amasiar@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | next-major-0.1X |
| Component: | wiki system | Version: | 0.8.1 |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
Alternate templates for wiki pages could come really handy when you need to format the wiki text for the end users. For example users can click on a help button and the we can pop up a small window with documentation without any trac navbar or edit buttons.
Also, this would allow to separate "Project Page" with project description wiki pages and "Developer Page" with all the power of trac.
Attachments
Change History
comment:1 Changed 7 years ago by cboos
- Owner changed from jonas to cboos
- Severity changed from normal to enhancement
- Status changed from new to assigned
comment:2 Changed 7 years ago by cboos
I recently came across another Wiki system (was it MoinMoin?)
that allows you to choose a template when creating a new wiki page.
I think that's good and the way it should be:
while creating the initial revision of a page,
one should be able to select the template
to use (none by default).
Once a given XyzTemplate is chosen, an is-a relationship
is created from the new page to that XyzTemplate page.
The template drop-down box is created out of all
the available template pages (i.e. the all pages
that have a is-a relationship to the TemplateTemplate
page, plus the TemplateTemplate page itself for creating new
templates).
comment:3 Changed 7 years ago by cmlenz
- Component changed from general to wiki
comment:4 Changed 6 years ago by sid
Look like a duplicate of #962.
A patch to do this was applied in r3881 (in 0.11) (you can now use the PageTemplates/ prefix for a wiki page to specific a template).
comment:5 Changed 6 years ago by cboos
Sorry, I think the confusion comes from my comments above, which mixed the original request with the idea of PageTemplates.
PageTemplates are effectively implemented for 0.11, but it's still not possible to specify an alternate display style for a given page.
comment:6 Changed 5 years ago by cboos
- Milestone set to 2.0
- Owner cboos deleted
- Status changed from assigned to new
comment:7 Changed 2 years ago by cboos
- Milestone changed from 2.0 to unscheduled
Milestone 2.0 deleted
comment:8 Changed 2 years ago by cboos
So back to the original topic, being able to have different styles of presentations for wiki pages.
Perhaps to relate with #3021 (see for example MediaWiki:Help:Namespaces#Identifying_namespaces).
See also #9248. If we have a first line going like #!wiki class=... or #!div style="..." this can also be used to have custom presentation styles. Note that this is already mostly possible with a toplevel #!div blocks, but maybe it would be possible to go even further if we know the parameters apply to the whole content (like the new window trick suggested for Help: pages).
comment:9 Changed 2 years ago by cboos
- Milestone changed from triaging to next-major-0.1X
- Priority changed from normal to low



I have similar wishes, but how to implement it?
One way would be to subclass the WikiModule,
the other other would be more flexible,
using is-a relations (relationships are
not yet available on the trunk, but on the
xref-branch).
In your example, you would prepare a ProjectPage
which would be the template for all your project pages,
E.g. if TestProject is-a ProjectPage, then
it will be displayed according to what is specified in
the ProjectPage:
The above syntax is not really pretty, of course.
While browsing the ProjectPage, there should be
a form enabling the creation of a new Project…