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

Roan Kattouw <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Roan Kattouw <[email protected]> 2010-07-15 18:00:14 
UTC ---
(In reply to comment #2)
> If you only want to find out if one template is used, it may be easier to put
> an id or class within it. For example, at the German Wikipedia, the deletion
> template uses the id "Vorlage_Löschantragstext".
> 
> You could  then use
> 
> if (document.getElementById('Vorlage_Löschantragstext')) {
> stuff to do if there's this template;
> }
> else {
> something else;
> }
> 
> However, the latter method of course has the disadvantage that people could
> just add the id without adding the template, so it's not as stable as the API
> result or a possible wgTemplates variable.
This is a very bad idea for a general solution, because 1) template names might
be legitimate section names or conflict with other IDs and 2) not all template
names are valid IDs

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to