Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I want to make it easier for myself to create references in my wiki.

My current setup is that I have to do something like this:

<ref name="120507">Reference for something that happened on the {{createdate|120507}}</ref>

The template create date just turns the string YYMMDD into dd month YYYY

I want to simplify this by only needing:

{{ref|120507}}

But I cant seem to get the property right, and it won't traverse into the template createdate either. It just URL-encodes the curly brackets instead of taking the value of {{{1}}}.

<ref name="{{{1}}}">Sometext {{createdate|{{{1}}}}}.</ref>

This is what I tried.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You can use the {{#tag}} magic word to do this. So, your template would look something like this:

{{#tag:ref|Sometext {{createdate|{{{1}}}}}.|name={{{1}}}}}

Although exactly this code wouldn't work correctly, because name cannot be an integer.

share|improve this answer
    
Thanks! How would I have to do it if I want <ref name="{{{1}}}"/>? –  Eikern May 8 '12 at 9:03
1  
It's explained on the page I linked to. It's {{#tag:ref||name={{{1}}}}}. –  svick May 8 '12 at 9:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.