XF 2.0 Setting canChangeLanguage and canChangeStyle

ge66

Well-known member
There is the following in two templates:
<xf:if is="$xf.visitor.canChangeLanguage()"> and
<xf:if is="$xf.visitor.canChangeStyle()">
I wonder if there is somewhere you can set them to no somehow for all but admin without changing the templates and wrapping the sections in conditionals.
 
You'd be looking to have to write an add-on which changes those two methods in the User entity.

Though, not sure why you'd avoid template changes for this. It just requires adding $xf.visitor.is_admin to the existing conditional in the template.
 
Was just wondering if there was a permission or an option somewhere in admin panel for this as I am not understanding why there is an "if is=" if you can't set it.
 
canChangeLanguage() checks if there's more than one language, and therefore will only display the language selector if there is more than one language.

canChangeStyle() checks if there's more than one style that is user selectable.
 
Thank you for explaining that.

That works nicely with styles as admin you can have just one style enabled, users can't change style but as admin you can.

I think it should be possible to disable languages to have the same effect for them.

I have liked at least one of the suggestions about this.
 
Back
Top Bottom