[Template Tweak] Hide/Limit Style and Language Chooser

Status
Not open for further replies.

Stormraven

Trusted Member
Oct 24, 2010
1,836
0
150
36
Wales, UK
www.prowebforums.com
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 :)
 
  • Like
Reactions: 3 people

ragtek

OMG Member
Jul 4, 2007
149
0
55
40
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
Oct 24, 2010
1,836
0
150
36
Wales, UK
www.prowebforums.com
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 :)
 

Cezz

OMG Member
Sep 24, 2010
581
48
255
37
United Kingdom
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...
 
  • Like
Reactions: 3 people

Stormraven

Trusted Member
Oct 24, 2010
1,836
0
150
36
Wales, UK
www.prowebforums.com
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.