[Template Tweak] Hide/Limit Style and Language Chooser

Status
Not open for further replies.

Stormraven

Trusted Member
Joined
Oct 24, 2010
Messages
1,836
This a template tweak, but only a very small one. I decided to hide the style and language chooser from view on my site and decided to share how I went about doing it with the community.

It's always good practise to comment out code so that if you want to revert back, you can easily do so.

To hide the style chooser, open up the footer template and find:

Code:
<xen:if is="{$canChangeStyle} OR {$canChangeLanguage}">
<dl class="choosers">
<xen:if is="{$canChangeStyle}">
<dt>{xen:phrase style}</dt>
<dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}">{$visitorStyle.title}</a></dd>
</xen:if>

Replace with:

Code:
<!--<xen:if is="{$canChangeStyle} OR {$canChangeLanguage}">

<dl class="choosers">
<xen:if is="{$canChangeStyle}">
<dt>{xen:phrase style}</dt>
<dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}">{$visitorStyle.title}</a></dd>
</xen:if>-->

To hide the language chooser, open up the footer template and find:

Code:
<xen:if is="{$canChangeLanguage}">
<dt>{xen:phrase language}</dt>
<dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase language_chooser}">{$visitorLanguage.title}</a></dd>
</xen:if>
</dl>
</xen:if>

Replace with:

Code:
<!--<xen:if is="{$canChangeLanguage}">
<dt>{xen:phrase language}</dt>
<dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase language_chooser}">{$visitorLanguage.title}</a></dd>
</xen:if>
</dl>
</xen:if>-->

Or to hide both, you'll simply need one set of comment around both sections of code. Alternatively if you want to limit the style or language chooser to certain member groups, you can find the conditionals to do so here.

Enjoy :)
 

ragtek

OMG Member
Joined
Jul 4, 2007
Messages
149
You know that people are still able to change the style & language?;)

You've just commented the html output...
Your users just have to take firebug, remove the comment tags and .... they're able to switch the styles & languages;)

Create a plugin at container_public_params and unset the params canChangeStyle & canChangeLanguage
 

Stormraven

Trusted Member
Joined
Oct 24, 2010
Messages
1,836
I decided to hide it because I don't want members changing styles, plus I only have one language. If I had more than one language added, I wouldn't comment it out :)

It's just I prefer it this way :D I have two styles, the default and a second one, I've disallowed members to choose the default, and I only have one other style, so it seems pointless having a style chooser and language chooser so I decided to comment them both out :)
 

Steven Moore

OMG Member
Joined
Oct 22, 2010
Messages
1,084
Good idea Storm, I may do that for the language part. Styles on the other hand, I have a few in the works I have to add so my main site will be a style demo. LOL

Great job, I love it though.
 

Cezz

OMG Member
Joined
Sep 24, 2010
Messages
581
You are probably better off using <xen:comment> instead of the <!--- html comment that way the code wont be parsed, won't show in view source and can still be added back when needed...
 

Stormraven

Trusted Member
Joined
Oct 24, 2010
Messages
1,836
You are probably better off using <xen:comment> instead of the <!--- html comment that way the code wont be parsed, won't show in view source and can still be added back when needed...

Hi Cezz, only just noticed your reply in this thread. Thanks very much for that, I'm learning all the time :) Thanks for the tip :)


Thank you very much :)
 
Status
Not open for further replies.
Top