XF 2.1 Custom User Field / Expand Quotes

Kaitou

New member
So basically what I want is to give users the option to expand quotes or not.

Found this to automatically expand quotes, which works.
Code:
.bbCodeBlock--expandable .bbCodeBlock-expandContent {
    max-height: 100%;
}

But not all users want that option so I'm trying to make it a user preference. I already made the User Field

1562050160130.png
1562050197887.png

And with various google searches I came up with this and putting it on the message.less template but it does nothing. It doesn't work. I wasn't expecting it since I'm just putting things together and test my luck. Not sure what I'm doing.

Code:
<xf:if is="{$xf.visitor.custom_fields.expandquotesauto.on} == 'on'">
<style>
.bbCodeBlock--expandable .bbCodeBlock-expandContent {
    max-height: 100%; 
}
</style>
</xf:if>

Any help is appreciatied.
 
Last edited:
Conditional statements of that nature are unlikely to work in less templates.

Thanks! Where is the best place to achieve what I am trying to do?

EDIT: I got someone messing with the bb_code_tag_quote page. Would that be right?

EDIT2:

Code:
<xf:if is="$xf.visitor.custom_fields.expandquotesauto == true">
            <style>
                .bbCodeBlock--expandable .bbCodeBlock-expandContent {
                max-height: 100%;
                }
            </style>
        <xf:else />
            <div class="bbCodeBlock-expandLink"><a>{{ phrase('click_to_expand') }}</a></div>
        </xf:if>
unknown.png

unknown.png

unknown.png


If I set the conditional to == false, then the if statement fires everytime regardless of if the check box is check or not checked, and if i set the conditional to == true, then the statement never fires ever and always shows the click to expand My question is why? I dont know if Im missing a value?
 
Last edited:
Back
Top Bottom