XF 2.0 Overriding pageWidthMax in a template?


Active member
In XF1.5 I had a yes/no custom user field allowing those who wanted it to restrict their pagewidth to 1140px
I put a template mod in, adding this to the header
<xen:if is="{$visitor.customFields.pref_maxwidth} == 'yes'"><xen:require css="extra_max_width.css" /></xen:if>

and in extra_max_width.css I had
max-width: 1140px!important;
margin: auto;

Now in XF2.0 I think it's the other way round. The max width is set in Style Properties > Page Setup > pageWidthMax = 1140px

So I'm trying to implement a similar method as above, but to remove the max-width.

Added a template modification in helper_js_global to add the less file
<xf:set var="$cssUrls" value="{{ array_merge($cssUrls, ['public:mb_maxwidth_extra.less']) }}" />
(The if statement comes later, just want to get it working first)

In mb_maxwidth_extra.less I have
    max-width: none !important;
    padding: 0 @xf-pageEdgeSpacer;
    margin: 0 auto;

I know I'm going wrong completely, but could someone point me in the right direction?
Top Bottom