XF 2.0 Overriding pageWidthMax in a template?

Marcel

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
Code:
<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
Code:
.pageWidth
{
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
Code:
<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
Code:
.m-pageWidth()
{
    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