Jump to content

Featured Replies

Posted

Is it possible to get the current forum view method (table, fluid etc.) in code?

I notice that the URL to set the method contains these parameters so was hopeful they could be easily retrieved somehow in JS:

do=setMethod&method=fluid

 

Solved by Daniel F

Go to solution

Grab a cookie...

Could contain: Text, Page

var view = ips.utils.cookie.get('ips4_forum_view');

 

  • Solution

It's also stored in the database, so using the method is probably better

\IPS\forums\Forum::getMemberListView()

 

1 hour ago, Mick23 said:

somehow in JS:

Cookie GIF by NBC

But using Daniel's suggestion you could get the value using that code, add it as a data attribute to something in a template and then grab that using JS code up front. A few more lines of code though.

Edited by Nathan Explosion

Recently Browsing 0

  • No registered users viewing this page.