As an editor I should be able to add a magic word that updates the banner on the current page.
Suggested usage:
{{PAGEBANNER|File:Foo.jpg}}
As an editor I should be able to add a magic word that updates the banner on the current page.
Suggested usage:
{{PAGEBANNER|File:Foo.jpg}}
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| WikidataPageBanner: PAGEBANNER magic word added | mediawiki/extensions/WikidataPageBanner | master | +139 -30 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Sumit | T77925 Wikidata PageBanner extension | |||
| Resolved | Jdlrobson | T94772 Page banner placeholder | |||
| Resolved | Jdlrobson | T97455 As an editor I want to be able to control the page banner I see on a page |
In T94772, I'm rendering a static banner, using 'viewBanner' hooked to 'ArticleViewHeader' which ideally should insert a banner only when no {{PAGEBANNER...}} is found. To achieve that, I can use a control variable to suppress the functionality of 'viewBanner' whenever the parser detects the {{PAGEBANNER..}} magic word. However this introduces coupling between these two functions, with a variable. Is this approach fine, or can there be a better solution?
I'd rather use {{PAGEBANNER:File:Foo.jpg}} (: instead of |) as it is done for {{DISPLAYTITLE}} and other configurations as well.
This makes clear that it is a magic word and not a template.
Change 209432 had a related patch set uploaded (by Sumit):
WikidataPageBanner: PAGEBANNER magic word added