Forum:Alternative text for logged out users

Is there a way to get a page to display different text to logged out users than to logged in users? For example, a logged in user would see:

General text section Text section A General text section

and a logged out user would see:

General text section Text section B General text section

Thanks, Enodoc (Talk ) 18:16, December 23, 2011 (UTC)


 * I don't think is easily possible using built-in MediaWiki functions. There's a good chance you can do it through JavaScript (using the same function a lot of wikis have that echo back username and then doing some sort of regex test to see if the user name is an actual user name or IP address), but honestly even then I'm not convinced it would be 100% effective. --daNASCAT http://images2.wikia.nocookie.net/__cb32675/wikia/images/e/e9/WikiaStaff.png (help forum | blog) 19:07, December 26, 2011 (UTC)


 * You can use this javascript code to check if the person is logged in:

if (wgUserGroups == null) { //code to run when we are logged out } else { // code when logged in }
 * That's probably easier than regexing the user name. To swap the messages, you could use 2 CSS classes and then set the correct one visible with the javascript. - Tjcool007 (Talk) 20:55, December 26, 2011 (UTC)