Last modified: 2011-04-14 15:10:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 2187 - Feature request: page layout templates
Feature request: page layout templates
Status: NEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2005-05-16 13:15 UTC by David Biesack
Modified: 2011-04-14 15:10 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description David Biesack 2005-05-16 13:15:05 UTC
I want to define page layout templates - not the current Templates that are more
like macros, but rathera common page layout that I can associate with pages, for
example with a new namespace "Layout:",


or perhaps indirectly by associating a layout with a category, or as a choice in
the page editor.

For example, I may want to automatically include a header, navigation, and
footer template on a subset of pages, for example, for articles about Eclipse. I
may define a layout, called [[Layout:Eclipse]], as follows


However, I don't want to have to include these templates in each and every page
in the Eclipse category.
Rather, I would like to create a [[Layout:Eclipse]] page layout and by
referencing [[Layout:Eclipse]] on these pages (similar to how one references
categories), it will use that page layout; i.e. automatically include the
heading, navigation, and footer. Such layouts may contain <div> or <table> or
other layout markup, whether (restricted) html or wiki.
(I'm suggesting one implementation; other implementations for assiging a page
layout to
a page are also possible.)

When a page is previewed or saved, its body is substituted where
{{Page:content}} (or some other meaningful marker/variable) appears, and the
other templates/markup inserted as if they were on the original page. User's
editing such pages would not have to explicitly include this boilerplate, and I
could change this page layout template once and all pages which use it would
render with the new layout.

Only one page layout is needed per page, although I can see how it may be
possible/desirable to nest them via a Decorator pattern; the output of applying
one page template then becomes the {{Page:content}} for the next. This would be
tricky; you would not want to reformat/reinterpret the text as markup. In
addition, some layouts may themselves reference other layouts. (Beware of
cycles, though!)

Finally, I would expect to have a default page layout for the site; i.e.
[[Layout:default]] or [[Layout:site]]. For example, there is an implicit page
layout template already which includes MediaWiki:Sitenotice and
MediaWiki:Tagline. I would like to make it more explicit and customizable and
allow different pages or categories to have their own custom page layouts
(either replacing or augmenting other layouts).
Comment 1 David Mestel 2008-05-29 09:16:26 UTC
I may be being dense, but couldn't your example be just as easily implemented with a Template:Eclipse, consisting of

To then be called with {{(subst:)Eclipse|content=An eclipse is a rare event...}}?
Comment 2 David Biesack 2008-05-29 15:00:22 UTC
My proposal would all changing the template after it has been instantiated,
and all articles using the template would automatically update.
Using subst "erases" the link to the template. Also, full
page content is often too large/awkward to fit into a template call.
Comment 3 David Mestel 2008-05-29 17:47:23 UTC
In that case you could not subst the template.  It's not particularly awkward - all you have to do is have a first line with "{{Eclipse|content=", and a final line with "}}".
Comment 4 David Biesack 2008-05-29 19:24:08 UTC
That does not work if the content contains other template invocations or tables.

For example, see

which I use in

Note how the table is lost
Comment 5 David Mestel 2008-05-30 08:19:38 UTC
I stand corrected.  That seems a bit rubbish: time to dive into the parser and make tables work properly :-)

Note You need to log in before you can comment on or make changes to this bug.