Forum:Problem transclusing template in Welcome-user-page

Hi guys, I created this User profile template and added it to the Welcome-user-page so every time someone made his first edit, a infobox would automatically be added to his Profile. But instead of transclusing correctly, it added the entire codes of the User profile template. Is there anyway to fix this? Arciusazrael 15:45, March 14, 2012 (UTC)


 * I'd first try to place   tags around the template and see how that works. The bot should drop the nowiki tags and leave just the template info when transcluding which should be what you are wanting. Rappy 19:54, March 14, 2012 (UTC)
 * That seems like a clever solution. Could help me a little bit more by making a random edit on my wiki, see if it works? I really ran out of email to create new account to test this :( Arciusazrael 02:51, March 15, 2012 (UTC)


 * Unfortunately, that didn't work. Rappy 03:11, March 15, 2012 (UTC)
 * Yeah, I just saw it. But thanks for helping Rappy Arciusazrael 03:13, March 15, 2012 (UTC)


 * You might want to experiment with a different MediaWiki message. MediaWiki:Welcome-user-page is a pain in the a*** to test. How about MediaWiki:Newarticletext instead?


 * And have you tried &lt;includeonly&gt; ? -- Pecoes 04:33, March 15, 2012 (UTC)
 * Thanks for the tips Pecoes. I tried &lt;onlyinclude&gt; with Newarticletext and it worked. Now I'll wait and see if it works with Welcome-user-page as well. Arciusazrael 06:14, March 15, 2012 (UTC)


 * Seems to work: w:c:valkyria:User:Pecoes. I gotta say: That's an interesting idea! I might steal that! :0) -- Pecoes 06:25, March 15, 2012 (UTC)

oh no, it doesn't work T____T. It adds the entire code of the template instead of: Arciusazrael 07:10, March 15, 2012 (UTC)

That's what I'm seeing. -- Pecoes 07:16, March 15, 2012 (UTC)


 * I mean, you have to go into edit mode to look at the code. Any user should be able to edit his profile easily, but with this mess, an average user who doesn't know wikicode would not be able to edit it. Arciusazrael 07:27, March 15, 2012 (UTC)


 * Ah. Sorry. I seem to have misunderstood your problem. In that case Rappy's suggestion probably wasn't far off. Maybe comining includeonly with nowiki will do the trick... I'll get back to you in an hour or so. -- Pecoes 07:36, March 15, 2012 (UTC)


 * Let's try something else then! Please edit this page a little! -- Pecoes 08:38, March 15, 2012 (UTC)
 * Sorry I went out. I just edited the page and get this on my profile:

Arciusazrael 13:49, March 15, 2012 (UTC)

No. Not good enough. That's the rendered template.

The problem is apparently that when you use a template in MediaWiki:Welcome-user-page it is substituted - whether you want to or not. My line of thinking was to work with nested templates: a primary template for the infobox and a secondary template that fills the infobox with default values. My hope was that the substitution might go only one level deep so that the end result would be the secondary template.

But that didn't work.

There are tricks for controlling multilevel substitution but I can't tell if you can also use them to break substitution...

Do you have another account, so we can try something else? -- Pecoes 14:42, March 15, 2012 (UTC)
 * Yeah, I have several accounts. Shall I make an edit now? Arciusazrael 14:59, March 15, 2012 (UTC)


 * Go ahead! -- Pecoes 14:47, March 15, 2012 (UTC)
 * Hey, it worked!! Arciusazrael 15:09, March 15, 2012 (UTC)


 * Wow! I'm surprised myself. :D


 * This is what I did: I had - again - two Templates. The primary template (Test) renders the table and the secondary template (Test2) calls the primary and feeds it some values.


 * Now it gets crazy. This is MediaWiki:Welcome-user-page:

$(${subst:Test2$)$}


 * Before you can use that trick you need to create two templates named "(" and ")" on your wiki - Template:( simply contains "{" and Template:) contains "}"


 * Now the trick is when you hit "Publish" the templates ( and ) will be transcluded but Test2 will not be substituted - at least not in this step. That happens when MediaWiki:Welcome-user-page is substituted into the user page.


 * So this is what MediaWiki:Welcome-user-page looked like after I hit "Publish":


 * Pecoes 15:23, March 15, 2012 (UTC)
 * You're awesome Pecoes! I got the idea, I'll try it with my wiki and let you know how it goes. Arciusazrael 17:04, March 15, 2012 (UTC)
 * works like a charm. Thanks so much for the help ;) Arciusazrael 02:16, March 16, 2012 (UTC)