Lee Robson

Registered
Hi russ,

Is it possible to update a user preference from the front end of xenForo?

I want to create a new preference for example ‘hide node xyz’ and have it as a toggle on the index page. Is this possible?

Cheers
 
Create a simple custom user field as a check box:
1707372920467.png


Then place this into your xb_header template. Obviously you'll need to make specific edits but I hope this helps.

Code:
<xf:if is="$xf.visitor.Profile.custom_fields.hidenode">
    <xf:css>
    .node.node--id5
        {
        display: none;
        }
    </xf:css>
</xf:if>
 
As far as I know, you'd need an add-on to have a custom field outside of the account preference page (at least so they can edit it outside of there).

We do have a simple node toggle feature that uses built in local storage feature, not as persistent as a custom user field would be. (Style properties -> Node/forum list -> Collapsible nodes)
 

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.

Back