Collapsable category
5 posters
Page 1 of 1
Collapsable category
Using this code here: https://help.forumotion.com/t130001-collapsible-categories
For this forum here http://noplacelikehome.forumotion.com/
I cant get it to work.Is this an older code? Is there a etter one I can use?
Thank you
For this forum here http://noplacelikehome.forumotion.com/
I cant get it to work.Is this an older code? Is there a etter one I can use?
Thank you
stluee- Forumember
- Posts : 47
Reputation : 0
Language : english
Re: Collapsable category
hello i have looked over your profile here and you don't have your Forum Version added to your profile can you please tell me what one you are using so we can give you the right code.
Thank you.
Also update your profile with your forum link and browser info this helps us work your problem out faster
EDIT: please look in the tips and tricks for most plugin's
https://help.forumotion.com/t102749-category-toggle-all-forums#668821
Thank you.
Also update your profile with your forum link and browser info this helps us work your problem out faster
EDIT: please look in the tips and tricks for most plugin's
https://help.forumotion.com/t102749-category-toggle-all-forums#668821
Re: Collapsable category
Using punb and that 2nd code didnt work either. I plaaced it in java like the instructions said.
I am helping the administrator.
I am helping the administrator.
stluee- Forumember
- Posts : 47
Reputation : 0
Language : english
Re: Collapsable category
Do you have JavaScript Management activated?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Collapsable category
I have tested the linked tutorial, and it does not work at all.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Collapsable category
ok This one is the one i use myself
This code is working 100% on phpbb3 and should work ok in all other forums to.
I know this is working as i am using it on my 3 sites
- Code:
/**************************************************************************
Category Toggle
***************************************************************************/
/***
* Application: toggle Category
* Description: Show/hide categories!
* Version: 0.02632015-jq1.9.1
* RC1 (Release candidate 1!) - Invision
* Author: JScript - 2015/03/26 - based on Invision.js
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
$(function() {
if (_userdata.page_desktop) return;
("JScript <jscriptbrasil at live dot com>, based on Invision.js");
var style = document.createElement("style"),
/* Versions:|phpBB2----------------------------------------| |phpBB3-------------| |PunBB-----------------| |Invision already have it!| */
oCat = $('#content-container .three-col td:eq(1) .forumline, #main-content .forabg, #main-content .main-head'),
oThis = null,
oTemp = null,
sEval = '';
style.type = "text/css";
style.innerHTML =
'.contract, .expand {' +
' background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
' cursor: pointer;' +
' float: right;' +
' padding-right: 55px;' +
' padding-top: 10px;' +
' padding-bottom: 19px;' +
' margin-top: -35px;' +
'}' +
'.expand {' +
' background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
'}';
document.getElementsByTagName("head")[0].appendChild(style);
switch (oCat[0].className) {
case 'forumline': //phpBB2
sEval = "oTemp = oThis.find('tr').first();oTemp.addClass('title-bar');" +
"oTemp.find('th:last').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\" style=\"margin-top: -15px;\"> </div>');" +
"oThis.find('tr').not('.title-bar').addClass('c' + i);";
break;
case 'forabg': //phpBB3
sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\"> </div>');" +
"oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
break;
case 'main-head': //PunBB
sEval = "oThis.find('h2').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\"> </div>');" +
"oThis.next().attr('id', 'c' + i);";
break;
}
for (var i = 0, len = oCat.length; i < len; i++) {
oThis = $(oCat[i]);
eval(sEval);
}
initCategories();
});
// by invision.js
function initCategories() {
var id;
cookies = document.cookie.split('; ');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].charAt(0) == '_') {
cookie = cookies[i].split('=');
if (cookie[1] == '1') {
id = cookie[0].substring(1);
if (document.getElementById(id)) {
toggleCategory(id)
}
}
}
}
}
// by invision.js, modified by JScript
function toggleCategory(id) {
var obj = document.getElementById(id);
var button = document.getElementById('b' + id);
if (obj) {
var toggle = obj.style.display == 'none';
obj.style.display = toggle ? '' : 'none';
} else {
var elems = document.getElementsByClassName(id);
for (var i = 0, len = elems.length; i < len; i++) {
var toggle = elems[i].style.display == 'none';
elems[i].style.display = toggle ? '' : 'none';
}
}
button.className = toggle ? 'contract' : 'expand';
my_setcookie('_' + id, toggle ? '' : '1', true);
return false
}
/*
▲ -> contract
▼ -> expand
*/
This code is working 100% on phpbb3 and should work ok in all other forums to.
I know this is working as i am using it on my 3 sites
Re: Collapsable category
APE wrote:ok This one is the one i use myself
- Code:
/**************************************************************************
Category Toggle
***************************************************************************/
/***
* Application: toggle Category
* Description: Show/hide categories!
* Version: 0.02632015-jq1.9.1
* RC1 (Release candidate 1!) - Invision
* Author: JScript - 2015/03/26 - based on Invision.js
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
$(function() {
if (_userdata.page_desktop) return;
("JScript <jscriptbrasil at live dot com>, based on Invision.js");
var style = document.createElement("style"),
/* Versions:|phpBB2----------------------------------------| |phpBB3-------------| |PunBB-----------------| |Invision already have it!| */
oCat = $('#content-container .three-col td:eq(1) .forumline, #main-content .forabg, #main-content .main-head'),
oThis = null,
oTemp = null,
sEval = '';
style.type = "text/css";
style.innerHTML =
'.contract, .expand {' +
' background: url("http://2img.net/i/fa/invision/exp_minus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
' cursor: pointer;' +
' float: right;' +
' padding-right: 55px;' +
' padding-top: 10px;' +
' padding-bottom: 19px;' +
' margin-top: -35px;' +
'}' +
'.expand {' +
' background: url("http://2img.net/i/fa/invision/exp_plus.gif") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
'}';
document.getElementsByTagName("head")[0].appendChild(style);
switch (oCat[0].className) {
case 'forumline': //phpBB2
sEval = "oTemp = oThis.find('tr').first();oTemp.addClass('title-bar');" +
"oTemp.find('th:last').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract" style="margin-top: -15px;"> </div>');" +
"oThis.find('tr').not('.title-bar').addClass('c' + i);";
break;
case 'forabg': //phpBB3
sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract"> </div>');" +
"oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
break;
case 'main-head': //PunBB
sEval = "oThis.find('h2').append('<div onclick="toggleCategory(\\'c' + i + '\\');" id="bc' + i + '" class="contract"> </div>');" +
"oThis.next().attr('id', 'c' + i);";
break;
}
for (var i = 0, len = oCat.length; i < len; i++) {
oThis = $(oCat[i]);
eval(sEval);
}
initCategories();
});
// by invision.js
function initCategories() {
var id;
cookies = document.cookie.split('; ');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].charAt(0) == '_') {
cookie = cookies[i].split('=');
if (cookie[1] == '1') {
id = cookie[0].substring(1);
if (document.getElementById(id)) {
toggleCategory(id)
}
}
}
}
}
// by invision.js, modified by JScript
function toggleCategory(id) {
var obj = document.getElementById(id);
var button = document.getElementById('b' + id);
if (obj) {
var toggle = obj.style.display == 'none';
obj.style.display = toggle ? '' : 'none';
} else {
var elems = document.getElementsByClassName(id);
for (var i = 0, len = elems.length; i < len; i++) {
var toggle = elems[i].style.display == 'none';
elems[i].style.display = toggle ? '' : 'none';
}
}
button.className = toggle ? 'contract' : 'expand';
my_setcookie('_' + id, toggle ? '' : '1', true);
return false
}
/*
▲ -> contract
▼ -> expand
*/
This code is working 100% on phpbb3 and should work ok in all other forums to.
I know this is working as i am using it on my 3 sites
I'm using a forumotion PHPBB3 forum and this does not work in it.
Re: Collapsable category
It isnt working on my side. Where is it placed ?Does this new code go to javascript?
stluee- Forumember
- Posts : 47
Reputation : 0
Language : english
Re: Collapsable category
yes it should be added to the JavaScript system and make sure the setting is turned on and marked as Home page only.
Similar topics
» Category Showing as "Forum" instead of the category name.
» how to separate other Category to other Category
» Category - New
» How do I add category's?
» Please help category and box
» how to separate other Category to other Category
» Category - New
» How do I add category's?
» Please help category and box
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum