Last modified: 2011-04-14 15:11:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24111, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22111 - Defining a template within a page
Defining a template within a page
Status: NEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-15 17:56 UTC by John McGrath
Modified: 2011-04-14 15:11 UTC (History)
0 users

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


Attachments

Description John McGrath 2010-01-15 17:56:31 UTC
I would like a way to define a template (or something equivalent), for use on a single page, within that page.  There are times when it makes sense to define a template that will only be used on one page, for example a "row template" for a single use table.  Creating a separate template has a few disadvantages:

* When trying to examine the WikiMarkup, you have to open multiple pages to see what is going on.

* Testing the template requires saving the template every time you make a change.  You cannot just use the preview feature to see how things will be formatted.

* The history of the main page and the template are separate, so retrieving old versions can result in mismatches.

I would like instead to do something like this:

    #defineTemplate row
    |-
    | style="font-weight: bold; text-align: left" | {{{name}}}
    | style="text-align: right" | {{{age}}}
    | style="background-color: #DDD; text-align: right" | {{{salary}}}
    #endTemplate

    {|
    {{row | name="Sally" | age="25" | salary="$50,000" }}
    {{row | name="Dick" | age="30" | salary="$75,000" }}
    {{row | name="Jane" | age="35" | salary="$100,000" }}
    |}

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


Navigation
Links