How to hide portions of text from site visitors

Fragment of a discussion from Project:Support desk
Jump to: navigation, search

I use CSS for that. Hide by default, but in the skin file add according CSS rules to show it for logged in users.

Subfader21:20, 7 February 2012

Thanks for the tip, but could you elaborate? Although I learned that in MW:Common.css or the skin's CSS you can define a class like

span.hiddentext { display:none; }

to be applied in a page in this way:

<span class="hiddentext">This text is hidden from view.</span>

so that a portion of text is hidden by default, I couldn’t find any CSS techniques to make things appear again for logged-in users.

What I've done instead is to use the 'group sidebar' from Extension:DynamicSidebar in combination with Extension:CustomSidebar.

Cavila MW 1.17, MySQL 5.5.16, Php 5.3.815:27, 14 February 2012

You need to edit the skin file, e.g. Monobook.php. If user is logged in (check for userrrights, e.g. "edit") then return

<style type="text/css">
.hiddentext { display:inline !important; }
</style>

Thinking about it again, it would be best to add user status css classes to the body tag. I opened a request for that on bugzilla: https://bugzilla.wikimedia.org/show_bug.cgi?id=34413

Subfader08:04, 15 February 2012

Ah, I see, thanks. I don't use Monobook myself, but there are probably equivalent CSS sections in skins such as those of Gumax that could make it work.

Cavila MW 1.17, MySQL 5.5.16, Php 5.3.811:24, 24 February 2012
 
 
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox