[Mediawiki-l] intra-page templates

Frederik Dohr fdg001 at gmx.net
Sat Jan 20 15:38:27 UTC 2007


Sorry for reviving this thread, but SMW proved to be a little overkill
for this.

As such "intra-page templates" (or local variables, if you will) would
be very helpful to us, we are considering creating a tiny extension for
this.
However, we don't have an experienced PHP programmer at hand; could
anyone point me to a simple template for replacing existing text in a
wiki page? I believe we could take it from there then.

In essence, all we want is something like this:
    <var name="definitions">
    var1="some variable"
    var2="yet another variable"
    </var>
    In the text, we now have <var name="var1"/> and <var name="var2"/>.
(I revised the originally proposed syntax... )

The idea popped up again while looking at the source code for the
Multilang extension, which does a similar thing, but unfortunately is
too complicated for me to understand...

It'd be great if there was a template for learning about how to do such
a thing - but if there isn't, well, this isn't exactly a vital issue...

Also, is there anyone else who'd benefit from this? Of course we'd make
the extension publicly available if we actually managed to get it working.


-- F.


----- Original Message -----
From: Fernando Correia
Date: 2006-12-04 18:15
> Semantic MediaWiki could be used to do this.
> 
> 2006/12/4, FDG001 at gmx.net <FDG001 at gmx.net>:
>> Hey guys,
>>
>> While I don't think this is possible (yet?), I still think it's worth
>> discussing:
>>
>> It'd be great if you could define variables on a page that could be
>> included in the text and which would then be expanded when displaying the
>> output.
>> Here's an example of what I mean (syntax arbitrary):
>>     <!-- variable definitions -->
>>     @status_done = <span style="color: green;">canceled</span>
>>     @status_inProgress = <span style="color: blue;">canceled</span>
>>     @status_canceled = <span style="color: red;">canceled</span>
>>     @document_manualEN = ''User Manual and Usage Notes''
>>     @document_manualDE = ''Benutzerhandbuch und Anwendungshinweise''
>>     <!-- text body -->
>>     This is an overview of current tasks:
>>     * Install MediaWiki %status_done%
>>     * Create Help pages %status_inProgress%
>>     * Go on vacation %status_canceled%
>>     * Create manuals:
>>     ** %document_manualEN%
>>     ** %document_manualDE%
>>     ** ensure consistency between %document_manualEN% and
>> %document_manualDE%
>> (sorry for the lack of creativity in this example, but it should suffice
>> to get my point across)
>>
>> I believe this could enhance consistency within structured pages, and
>> would probably be easy to implement - and learn - as well (too bad I'm not
>> very experienced with PHP).
>> While I guess the same could be achieved with regular templates, it can be
>> quite bothersome having to create a new template page for each tiny element
>> - not to mention the issue of coming up with unique names for a large number
>> of templates that are each only used on one particular page...
>>
>> Any thoughts?
>>
>>
>> -- Frederik
>> --
>> "Ein Herz für Kinder" - Ihre Spende hilft! Aktion:
>> www.deutschlandsegelt.de
>> Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's
>> Cup-Yacht!
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l at Wikimedia.org
>> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> 




More information about the MediaWiki-l mailing list