[OGDev] Templating

chris at prather.org chris at prather.org
Wed Apr 5 04:29:26 BST 2006


> Talking to Chris Schmidt on IRC at the moment about macros. He's just
> coded
> up @INCLUDE [[Foo]] to include the whole content of "Foo". I was saying
> that
> it would be nice to have templates much the way MediaWiki does. He said:
>
> "Just specify that @TEMPLATE (Template:Fillin|Variable1|Variable2) will
> load
> ?id=Template:Fillin, and replace Variable1 with the content of variable1".

This sounds suspiciously like an idea that came up on IRC ... erm
yesterday? (whenever you brought back oglog) with Typed nodes. Template
being yet another type, in addition to possibly User, Image, etc. Although
a quick glance at the Trac didn't reveal anything, I thought this had been
brought up before.

> As I understand it you could just pass any number of variables into a
> template call, effectively giving each template its own @_.
>
> He continued: "The biggest problem is picking a syntax that won't cause
> other problems. Most of the current macros use [[ ]] but that results in
> it
> being treated as a link so you get lots of extra backlinks."
>
> I commented that we could use {{}} for templates instead - again,
> following
> the MediaWiki model - and avoid this. We could also drop the "@TEMPLATE"
> prefix which would be unnecessary. I'd actually like to deprecate all the
> @THING prefixes if at all possible and use {{}} markup. Here are some
> suggestions:
>
> * {{index_link}} = "@INDEX_LINK [[Cat or Loc You're Looking At]]",
> likewise
>   for {{index_list}}.
> * {{index_link|Category Foo}} = "@INDEX_LINK [[Category Foo]]" variable
>   being passed in as mentioned above.
>
> index_link and index_list are obviously reserved words as builtins so you
> shouldn't be able to define templates called that.

Why would these two be special? Why not just simply create these two
templates when you do a config/install whatever?

-Chris



More information about the OpenGuides-Dev mailing list