Page MenuHomePhabricator

Can't create field tag default with transcluding MediaWiki balise
Closed, ResolvedPublic

Description

I would like the page created with the form to be part of the 'Publication' category. But I don't want this category to be included when I include the page in another. So I added the <noinclude> tags from MediaWiki. The problem is that the category is not added to the form page because of the <noinclude> tag. Is there a way to ignore the <noinclude> tag in the 'default' parameter ?

{{{standard input|free text|rows=3|default=<noinclude>[[Category:Publication]]</noinclude>}}}

Event Timeline

I assume by "balise", you mean "tag". But why not put this category tag into the template, rather than on each page?

Yes I mean tag (sorry for my bad english).

My goal is for the form to create a Publication category page containing my template. And if I put this page in another then it displays the template but is not in the 'Publication' category.

I precise that if I put this : <noinclude>[[Category:Publication]]</noinclude> in the form field that work well. The problem happen when I want the text by default.

Sorry it's difficult to be clear...

Okay - it seems to me that the ideal situation would be that the category call goes into the template - but does not apply to the template itself, but does apply to any page that calls that template, but does not apply to any page that transcludes one of those pages. :)

This sounds tricky, but I think it's actually doable. The key is to put the category tag in a <noinclude> tag within the template's <noinclude> tag - but to somehow obfuscate the inner <noinclude> tag, so that the parsing of the template does not handle it. I think you can do this by changing some or all of that inner <noinclude>'s angular brackets into &lt; and &gt; HTML tags, and/or replacing parts of them with little mini-templates, like you might have </noin{{clude}}, where "Template:clude" holds the string clude>. Something like that - if it worked - would be a hack, but I think it would be a much better solution overall.

I add this line at the end of my template :
<noin{{clude}}[[Category:Publication]]</noin{{clude}}

The template clude contain : clude>

Now my template is part of Publication category but a empty <noinclude></noinclude> tag appear on the template and also when I transclude the page created by the form.

Thank you for your help but the hack seems not work...

Your hack work when I put : <noin{{clude}}[[Category:Publication]]</noin{{clude}} in the default parameter but don't work its directly in the template. Its a bit weird but the result corresponds to what I wanted.

So thank you for your help !

Yaron_Koren claimed this task.

Well... that's an okay solution. I still think it's possible, somehow, to create a <noinclude> substitute that works directly in the template. But if you got this working, then I guess there is no longer a Page Forms issue.