XF 2.0 Where does data-xf-init="toggle-storage" store data?

Brettflan

Active member
I want a way for users to be able to hide categories they aren't interested in, like is possible in SMF, the software we're migrating from, so I was considering this addon:
https://xenforo.com/community/resources/collapsible-node-categories.6176/

However, I couldn't determine offhand where it's actually storing the data. I can see this snippet is where that's handled, through "data-target" and "data-storage-key" values and so forth:
HTML:
<span id="collapse-{$node.node_id}" class="collapseTrigger collapseTrigger--block is-active" data-xf-click="toggle" data-xf-init="toggle-storage" data-target=".block--category{$node.node_id} .block-body" data-storage-key="_node-{$node.node_id}"></span>

I've searched around and was unable to any info on how that actually works in XenForo. Google and even the search functionality of the XenForo site here didn't turn up anything useful. I asked this in the discussion thread for that addon several days back but didn't get an answer, so I decided to ask over here where I might get more eyes on my question.

Is it stored in the database? I found several blobs in tables which might be used for it. Or, it could be in the data or internal-data folder somewhere, though I couldn't find anything likely there. It might even be stored as a cookie for all I know; in this particular case I'd actually maybe prefer that, though I don't think it's the case.
 
Hi,

I have added this add.on and I actually love it.

Unfortunately, the last setting, i.e. whether a forum is collapsed or not, is lost when the user logs off.
Does anyone know, what I need to do to store these settings persistently (beyond log in/log out)?
 
Hey Masetrix,

thanks for the reply.
Now I'm just stuck and don't know where I can change the "Expiry Date" for the cookie? Do I have to search the ACP (if yes, where?) or is it a direct manipulation in the SQL database (if yes, in which table?)?
Sorry for my missing knowledge, I still quite new to XF...
 
XF 2.1

I would also like to know how to change this code line so that the cookie stays stored longer than just the current session. I have been searching for days, but could only find the mistake.
Code:
<span id="collapse-{$node.node_id}" class="collapseTrigger collapseTrigger--block {{ !is_toggled('_node-' . $node.node_id) ? ' is-active' : '' }}" data-xf-click="toggle" data-xf-init="toggle-storage" data-storage-type="cookie" data-target=".block--category{$node.node_id} .block-body" data-storage-key="_node-{$node.node_id}"></span>
@Chris D @Mike Please? ;)
 
Last edited:
Top Bottom