https://bugzilla.wikimedia.org/show_bug.cgi?id=22297

           Summary: There should be syntax for substitution that doesn't
                    break normal transclusion
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Templates
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: conrad.ir...@gmail.com
            Blocks: 5453


At the moment it is not possible to create a template that substitutes the
results of parser functions when substituted and that also works when the
template is not substitued.

For example of current status:

Template:X {{<includeonly>subst:</includeonly>#if:{{{1|}}}|1|2}}

{{subst:X}} is transformed into "2" as expected, but
{{X}} generates "{{subst:#if:|1|2}}" - ooops. 

This feature can be used to good advantage, and some templates use a
conditional around something that subst:s to nothing to warn users that they
must substitute the template. 

I would like to propose an additional prefix "safesubst:" or words to that
effect, which gives the same result in both cases above.

Template:X {{<includeonly>safesubst:</includeonly>#if:{{{1|}}}|1|2}}

{{subst:X}} is transformed into "2", as before
{{X}} generates "2" when it is rendered, as expected, and
{{safesubst:X}} works exactly like {{subst:X}}

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are watching all bug changes.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to