Hi there, I would like to define a template, say {{begin}}, to start a <poem> (and other stuff). Then another one, say {{end}}, to finish the </poem> (and other stuff).Note that I have activated the poem tag on my wiki, and it works just fine.However, if I define the first template to be exactly "<poem>", and the other one to be exactly "</poem>", it doesn't work. Perhaps the first template works, but the closing tag is shown verbatim as "</poem>" in the rendered contents of the wiki. Mysteriously, the trick works just fine with a less exotic "<b>" and "</b>" pair.Your help is most welcome! Thanks.
Topic on Project:Support desk
Product Version
MediaWiki 1.26.2
PHP 5.4.43 (cgi-fcgi)
MySQL 5.5.42-37.1-log
ICU 4.2.1
Here is a test case. The results are slightly different from what I get in my wiki, where I cannot see the starting <poem>. Basically I need some sort of <yeswiki>, the opposite of <nowiki>. Thanks.
Try with: {{subst:Test-begin-poem}}
and {{subst:Test-end-poem}}
Subst works thanks, but that's not what I am looking for. (I need a template to easily change the presentation of a big number of pages, which I want to keep consistent.) Should I file a bug?
- Try using "tags" then. Help:Magic_words#Miscellaneous
{{#tag:poem| First line Second line }}
- This will give:
First line
Second line
- Apparently, this is the common method when using Parser extension tags (e.g. <ref>) in templates.
Thanks, but same problem. Where did you read that this is how parser extension tags are transcluded?
I don't know why you want there to be two templates, when it can be done by just one.
In Template:Test-begin-poem, the code will be something like: {{#tag:poem|{{1}}}}}
and the template will be used in the article as:
{{Test-begin-poem |First line Second line}}
I have created a ticket here
Exactly what do you need in the template that I suggested earlier?
Also, I missed a bracket in it, it should actually be: {{#tag:poem|{{{1}}}}}
This worked fine for me as well. Thanks a lot.