How to hide portions of text from site visitors

Jump to: navigation, search

For the convenience of editors of my site, I’ve added a number of extra links (e.g. semantic forms) to the sidebar. However, because this is rather confusing to regular visitors who have not logged in, I was looking for a way to hide those links from them. Contrary to what is claimed on this page, CustomSidebar does not offer such functionality. As a workaround I was hoping I could embed these links in content pages using Extension:ConditionalShow, but this extension is broken as of 2008/2009.

Any ideas?

Cavila MW 1.17, MySQL 5.5.16, Php 5.3.820:18, 7 February 2012

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