Jump to content

Topic on Project:Support desk

Start template and end template for <poem>

11
51.7.118.91 (talkcontribs)

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.

51.7.118.91 (talkcontribs)

Product     Version

MediaWiki     1.26.2

PHP     5.4.43 (cgi-fcgi)

MySQL     5.5.42-37.1-log

ICU     4.2.1

Hopefully Acceptable Username (talkcontribs)

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.

AhmadF.Cheema (talkcontribs)

Try with: {{subst:Test-begin-poem}} and {{subst:Test-end-poem}}

Hopefully Acceptable Username (talkcontribs)

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?

AhmadF.Cheema (talkcontribs)
51.7.118.91 (talkcontribs)

Thanks, but same problem. Where did you read that this is how parser extension tags are transcluded?

AhmadF.Cheema (talkcontribs)

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}}
Hopefully Acceptable Username (talkcontribs)
AhmadF.Cheema (talkcontribs)

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}}}}}

CaldoSangue (talkcontribs)

This worked fine for me as well. Thanks a lot.

Reply to "Start template and end template for <poem>"