usmf Posted July 17, 2021 Posted July 17, 2021 (edited) Is it possible to set our entire forum to show all category boards in the toggled mode? Currently, they look like this: Each user can click the toggle close arrow on the right and make the category appear this way: I'd like the forum front page to keep all categories permanently toggled, showing a description for each category. To access the sub-boards, I'd like members to have to click into the category to see only the sub-boards in there. Is that possible? Thanks! Edited July 17, 2021 by usmf kmk 1
Solution Nathan Explosion Posted July 17, 2021 Solution Posted July 17, 2021 Edit forums -> front -> index -> index Find: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull'> Change it to: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull cForumRow_hidden' data-hidden="true"> SeNioR- and NerdCore 2
usmf Posted July 19, 2021 Author Posted July 19, 2021 On 7/17/2021 at 9:16 AM, Nathan Explosion said: Edit forums -> front -> index -> index Find: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull'> Change it to: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull cForumRow_hidden' data-hidden="true"> Thank you for this. Works perfectly!
Nathan Explosion Posted January 19, 2022 Posted January 19, 2022 This post was recognized by Marc! "Thank you for sharing" Nathan Explosion was awarded the badge 'Helpful' and 10 points. Asked via another topic - how to do the above for 'some' categories. Do the following: Identify the IDs of the categories you wish to have collapsed - the ID is in the URL for the category when you hover the mouse of the link for the category. Then... Edit forums -> front -> index -> index Find: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull'> Change to: {{$collapseThese = array();}} <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull {{if \in_array($category->_id,$collapseThese)}}cForumRow_hidden' data-hidden="true"{{endif}}'> Then populate the array() with the IDs of the categories: {{$collapseThese = array(1,3,5,9,11);}} Save the template. User action of toggling the category open/closed will override this Adriano Faria, Runitdown, Ehren and 1 other 4
Ehren Posted January 20, 2022 Posted January 20, 2022 @Nathan Explosion Nice solution - there's just a misplaced apostrophe with your code. The <li> line should be: <li data-categoryID='{$category->_id}' class='cForumRow ipsBox ipsSpacer_bottom ipsResponsive_pull {{if \in_array($category->_id,$collapseThese)}}cForumRow_hidden' data-hidden="true"{{else}}'{{endif}}>
Runitdown Posted January 22, 2022 Posted January 22, 2022 I did this change, but now the 1st category is closed and nothing else, by default https://gyazo.com/65fca62b0da6a9cb099fb879d507870a
Nathan Explosion Posted January 22, 2022 Posted January 22, 2022 (edited) Post a link to your site. Edited January 22, 2022 by Nathan Explosion
Nathan Explosion Posted January 22, 2022 Posted January 22, 2022 In the absence of a link to the site, here's my suggestions: Ensure that 3,4,5 are the IDs of the categories you want to have collapsed, and not the IDs of forums within a category You test this as a new user, and not someone who may or may not have already toggled open/closed the categories at some point - open a private/incognito window to avoid using locally cached cookies/storage that would contain the references to what you have done in that area.
Recommended Posts