Toggle menu
244 tis.
68
18
624,9 tis.
Hrvatska internetska enciklopedija
Toggle preferences menu
Toggle personal menu
Niste prijavljeni
Your IP address will be publicly visible if you make any edits.

Hrvatska internetska enciklopedija:Zamjena

Izvor: Hrvatska internetska enciklopedija
Ova stranica ukratko: Substitution is the one-time, permanent copying of template content on HIE. It differs from transclusion, which continually updates as the linked-to content changes.

Substitution is a different way of handling templates than normally done on HIE. Usually, templates are transcluded, which means that if the template changes, every page that uses it will update to reflect that change. This is the procedure used for most templates. However, some templates are instead substituted. This means that if the template changes, pages that use it will not change, and will continue to show the old version of the template. Some templates should always be substituted, while most should always be transcluded.

To substitute, add subst: after the opening braces, as in {{subst:page name}}. For example: substitution {{subst:Matematika}} in contrast to transclusion {{Matematika}}. The contents of Predložak:Matematika will be expanded (for any templates) and stored at each point where "{{subst:Matematika}}" is placed in a page. Note that ref tags refuse to run "subst:" unless temporarily renamed as "<xref name=xx>" or similar (see the bug report {{phab|T4700}} ).

This page also lists templates that should either always or never be substituted except in the imenskom prostoru HIE. Automated tools (a.k.a. bots) that do such replacements will never be used on the original template. If you are going to use a bot to substitute templates, please read through the talk page first, as many are under dispute or change status over time, and substitution is permanent.

About subst:

Definition

The subst: keyword (short for "substitution") is used inside template code, placed as a prefix before the name of the template but within the curly braces ({{}}). It changes the way the MediaWiki software expands the template.

Ordinarily, a template will be expanded "on the fly"; that is, the template code on a page calls a separate page every time it is rendered. Although most page views are served from the cache, pages need to be rendered for previews and rendered again when the page changes. When someone is editing a page with a normal template call, they see the template call.

Placing "subst:" inside the curly braces tells the software to permanently replace the template with the text of the template (i.e., the text that is on the template's article page when the template is added to the page). Therefore, {{template}} becomes {{subst:template}}, until you save the page. The next editor sees not the template call, but instead the text of the template when you saved; it does not change even if the original template is edited.

Usage

You can substitute a template tag by adding "subst:" to it. For example, use {{subst:test5}} instead of {{test5}}.