Topic on Help talk:TemplateStyles

He7d3r (talkcontribs)
The <templatestyles> tag should be placed before the content that is styled, e.g. at the top of the template

Does that mean the template should also be added/moved to the top of the articles where it is used in case it contains styles used in more than a single section of the article?

Tgr (WMF) (talkcontribs)

<templatestyles> should only be used to style content that's contained or enclosed in the same template. If that's the case, it doesn't really matter where you place the template, as the <templatestyles> tag will always precede the styled content.

Anomie (talkcontribs)

If a template is supposed to affect content outside of the template itself, it should probably appear before that content. But ideally most templates will style only their own content so such placement doesn't matter.

Note that the Editing Contributors team has reserved the right to force templates to style only their own content in the future. Actually doing that would require some other significant changes to how templates work (e.g. T114445).

TheDJ (talkcontribs)

There's also some interesting points about Template fragments,, this feature and the future desires of VE of course.

If you look at templates that only output: <code>--data-sort-value="sortkey" |</code> to apply sorting to a table cell... That's just.. interesting.

Reply to "top"