Jump to content

Topic on Project:Support desk

can a template count what order it is in a page?

13
Evolution and evolvability (talkcontribs)

Is there a way for a template to count how many copies of itself are above it in the page? It'd be interested to have an 'auto vaue' in v:template:fig that works out the |number=parameter automatically.


(Copied at Topic:V0fffosf4ylovb9l)

AhmadF.Cheema (talkcontribs)
Evolution and evolvability (talkcontribs)

Wow, the phabricator discussions got pretty heated on that. Is it some specific issue with Extension:Variables, or some general issue with any similar functionality?

Ciencia Al Poder (talkcontribs)
Evolution and evolvability (talkcontribs)

@Ciencia Al Poder: Very interesting! Do you know if that sort of css is possible within mediawiki?

Ciencia Al Poder (talkcontribs)
Evolution and evolvability (talkcontribs)
Wargo (talkcontribs)

This is way utilizing TemplateStyles. You can also add to site CSS (see above) or to your CSS (if may be visible only for you).

Evolution and evolvability (talkcontribs)

Thank you. It seems to be getting there. I'm getting an error about sanitized css though:

Page User:Evolution and evolvability/sandbox/styles.css must have content model "Sanitized CSS" for TemplateStyles (current model is "CSS").

Is there a way to tell which part is unsanitary?

Wargo (talkcontribs)

Admin need to change "content model" from CSS to Sanitized CSS.

Ciencia Al Poder (talkcontribs)

Maybe the "Sanitized CSS" content model is only applicable for CSS under the template namespace and not the user namespace. If that's the problem, that's terrible for testing and should probably be reported as a bug.

Wargo (talkcontribs)

No. It is just not default. It can be changed by administrator in any namespace.

Evolution and evolvability (talkcontribs)