Jump to content

Topic on Manual talk:How to make a MediaWiki skin

Summary by Jdlrobson

Sitenotices are provided as an HTML string that is empty if no site notices are present. To conditionally render site notices:

{{#html-site-notice}}
{{{.}}}
{{/html-site-notice}}
Nasirkhan (talkcontribs)

{{{html-site-notice}}} shows the site notice, is there any way to get the data? can i check if there is any site notice?

Jdlrobson (talkcontribs)

There is no way to get at the underlying data. This is because of the way CentralNotice and other extensions work.

You are free to wrap the HTML in any HTML elements that you choose.

What is your use case here?

Nasirkhan (talkcontribs)

I will show the site notice within some HTML elements and I do not want to show that wrapper element if there is not notice to show. This is the primary need.


If I had the access to the data then I may try to format that in my way. But as you confirmed that it is not available, then that is ok too.

Jdlrobson (talkcontribs)

Mustache supports an if guard so you can conditionally render an element based on that. The string will be empty it there is no site notice to display.