Forums: Index → Support Requests → Alternative text for logged out users
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
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
(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 }