PDA

View Full Version : Hiding Categories


jasonscottphoto
Dec-24-2009, 04:51 AM
I am currently using this code to hide the category "Personal" from my Galleries page. How do I add an additional category to the code to hide multiple categories? Or, is there a better way to do this?


<!-- Hide Categories -->
function delCategory() {
re = /\/(Personal|Unlisted)$/;

var oList = YD.getElementsByClassName('miniBox', 'div', this);

for (i = 0; i < oList.length; i++) {
if (re.test(oList[i].getElementsByTagName('a')[0].href))
oList[i].parentNode.removeChild(oList[i]);
}
}
YE.onContentReady('categoriesBox', delCategory);
<!-- End Hide Categories -->

Allen
Dec-24-2009, 05:06 AM
I am currently using this code to hide the category "Personal" from my Galleries page. How do I add an additional category to the code to hide multiple categories? Or, is there a better way to do this?


<!-- Hide Categories -->
function delCategory() {
re = /\/(Personal|Unlisted)$/;

var oList = YD.getElementsByClassName('miniBox', 'div', this);

for (i = 0; i < oList.length; i++) {
if (re.test(oList[i].getElementsByTagName('a')[0].href))
oList[i].parentNode.removeChild(oList[i]);
}
}
YE.onContentReady('categoriesBox', delCategory);
<!-- End Hide Categories -->
Add them to this separated with a pipe |

re = /\/(Personal|Unlisted|anothercat|anothercat)$/;

jasonscottphoto
Dec-24-2009, 08:49 AM
Cool, thanks. I had seen that somewhere but then couldn't find it when I needed it. Just wanted to make sure I knew what I was doing :thumb