Help talk:Magic words
![]() Archives
|
---|
PAGENAME does not respect DISPLAYTITLE
editIf you are using {{DISPLAYTITLE}} to format a page name to have a leading lower case character (or really any formatting at all) the {{PAGENAME}} does not obey the display rule.
I think this is a bug.
47.186.29.164 47.186.29.164 01:12, 14 October 2023 (UTC)
- This is not a bug, but a missing feature. However, if you want that behavior, there's an extension that provides it. See Extension:Display Title. Ciencia Al Poder (talk) 16:14, 14 October 2023 (UTC)
- I wouldn’t even call it a missing feature. In many, probably most, cases,
{{PAGENAME}}
is used to get the page title for further processing (finding a subpage with the same name, its root page, using it in a conditional expression etc.). In these cases, any formatting is more harmful than useful. In addition, what if the wikitext fragment containing{{PAGENAME}}
is processed before the wikitext fragment containing{{DISPLAYTITLE:…}}
? It would lead to inconsistent results. —Tacsipacsi (talk) 13:39, 15 October 2023 (UTC)
- I wouldn’t even call it a missing feature. In many, probably most, cases,
- Indeed, adding such a "feature" would cause a huge mess. One could add a separate parser function "
{{READOUTTITLE}}
" ... but let me guess that some could object this idea, since it could be abused as a replacement for the malicious Extension:Variables. Taylor 49 (talk) 14:58, 17 March 2024 (UTC)
- Indeed, adding such a "feature" would cause a huge mess. One could add a separate parser function "
Add a new magic word although if it is expensive
editI suggest that the magic word "{{TRANSCLUSIONCOUNT}}" can be added, I'm sure it's quite expensive, what that function does is display the amount of transclusions it makes to itself, return 0 if is displayed on the source page, but return 1 if displayed from a page that transcludes the source page, return 2 if displayed from the page that transcludes the previous one, and so on, so it is possible to use it with "{{#ifexpr}}" to mainly prevent the main template containing that magic word from being transcluded a certain number of times 95.143.193.15 19:43, 4 October 2024 (UTC)
Usage of class="noresize"
editThe tables on this page appear to have recently been wrapped in class="noresize"
. I'm not entirely sure what the goal of doing this is (I imagine it's some kind of mobile support, although no information was provided in the edit summaries), but on Firefox on desktop it causes the tables to be enclosed in divs with scrollbars, with a pointless large block of space underneath them. It makes scrolling through this page substantially more inconvenient. I will revert this change, but if @Jdlrobson could explain what the purpose of these changes are, perhaps there is a way to apply the desired functionality without breaking the page on Firefox. SnorlaxMonster (talk) 06:12, 19 October 2024 (UTC)
- The noresize class is documented here: Manual:Interface/IDs_and_classes and is in the process of being applied automatically by MediaWiki, so I've added this with that in mind.
- Without it, tables overlap the sidebar on Vector 2022 and break the mobile site at certain resolutions as they are too large for the page: https://phabricator.wikimedia.org/F57626109 - impacting accessibility of important links
- The issue with Firefox is new, looks like a cosmetic issue rather than a functional issue (I agree it's broken but inaccessible links is a greater bug than a block of whitespace at bottom of the element) and looks like it could be an upstream browser bug to me. Let's file a ticket and report that on Phabricator. Jdlrobson (talk) 16:38, 19 October 2024 (UTC)
URL data matching mobile or desktop?
editfullurl, canonicalurl, etc. dont produce mobile view links while clicking them on mobile. is there a method to match output to the domain? if viewing on xx.m.yy.org the link should be the same and not xx.yy.org . RoyZuo (talk) 13:20, 29 November 2024 (UTC)
- I don’t think so – I’m pretty sure the parser cache is shared between desktop and mobile, so we have to pick a domain name to be saved there. (Normal internal links work because they contain no domain name at all, just domain-relative
/wiki/…
.) By the way, the whole mobile domain thing is a big hack – ideally, we’d have software that works greatly on small and large screens, with keyboard, mouse and touchscreen, and we wouldn’t have a separate mobile domain at all. But we’re far from that. —Tacsipacsi (talk) 22:04, 30 November 2024 (UTC)
WBREPONAME not mentioned
edit{{WBREPONAME}}
and possibly many other Magic words are not mentioned here. For example, en:MediaWiki:Exceeded-entity-limit-category reads Pages with too many {{WBREPONAME}} entities accessed
. {{WBREPONAME}}
produces Wikidata. Even though these magic words might not be widely used, I think all of them should be properly documented here. —CX Zoom (A/अ/অ) (let's talk|contribs) 20:15, 6 January 2025 (UTC)
- This page is only for magic words provided by MediaWiki core, not extensions. * Pppery * it has begun 20:40, 6 January 2025 (UTC)
- Oh, I understand now. Thanks! —CX Zoom (A/अ/অ) (let's talk|contribs) 20:47, 6 January 2025 (UTC)