Hiding The Page Title from the Body

Post Reply
User avatar
RabbiBob
Site Admin
Posts: 236
Joined: Tue Feb 06, 2018 2:07 pm
Location: BETA Mountain
Contact:

Hiding The Page Title from the Body

Post by RabbiBob » Sat Nov 17, 2018 11:14 am

There are a few drawbacks to Mediawiki when dealing with it "out of the box" and today I was editing the Robert Mandell interview written by Tara O'Shea. I wanted to title the page with the centered text, but it looks odd with the Page Title first, then a repeat below.

Sometimes Googling your problem is the way to go:

Code: Select all

{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);">{{FULLPAGENAME}}</span>}}
Mediawiki supports Templates, so let's make use of that:

https://betamountain.org/index.php/Template:HideTitle

Code: Select all

{{DISPLAYTITLE:<span style="position: absolute; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px);">{{FULLPAGENAME}}</span>}}
<noinclude>[[Category:News Templates]]</noinclude>

Now I can use the by invoking {{HideTitle}} on the page and the page has the look that was originally desired!

Post Reply