How to hide the Galleries of a Category on Home Page
jwalkeroh
Registered Users Posts: 165 Major grins
Allen suggested I post this here. I hope someone can point me in the right direction...
Much like hiding Galleries on the homepage, I'd like to set the Galleries Display: to galleries instead of categories, and I'd like all of the galleries from designated categories to not be displayed in the list of galleries.
I tried to tweak the "hide categories" javascript to no avail. Does anyone know how to accomplish this?
Is there a SM javascript expert out there that may know how to do this? I think it's possible -- I'm just not that proficient with javascript yet. If you could just get pointed in the right direction I'd appreciate it.
I posted earlier in a differnet thread but no one responded (http://www.dgrin.com/showthread.php?t=48082&page=5). Thanks in advance for helping out.
Much like hiding Galleries on the homepage, I'd like to set the Galleries Display: to galleries instead of categories, and I'd like all of the galleries from designated categories to not be displayed in the list of galleries.
I tried to tweak the "hide categories" javascript to no avail. Does anyone know how to accomplish this?
Is there a SM javascript expert out there that may know how to do this? I think it's possible -- I'm just not that proficient with javascript yet. If you could just get pointed in the right direction I'd appreciate it.
I posted earlier in a differnet thread but no one responded (http://www.dgrin.com/showthread.php?t=48082&page=5). Thanks in advance for helping out.
-jw-
le pere de www.nikiwalkerphotography.com
le pere de www.nikiwalkerphotography.com
0
Comments
le pere de www.nikiwalkerphotography.com
le pere de www.nikiwalkerphotography.com
http://www.nikiwalkerphotography.com/galleries
I'd like to not have the Portfolio"n" galleries appear in the Galleries box, and don't want to hide them either. Thanks.
le pere de www.nikiwalkerphotography.com
Now the second challenge: How can I have this happen just on the homepage and not a category page?
function delGallery() {
re = /\/(5144046_32NsP|5144110_myhEX)$/;
var oList = YD.getElementsByClassName('miniBox', 'div', this);
for (i = 0; i < oList.length; i++) {
if (re.test(oList.getElementsByTagName('a')[0].href))
oList.parentNode.removeChild(oList);
}
}
YE.onContentReady('galleriesBox', delGallery);
le pere de www.nikiwalkerphotography.com
Add this...
SmugMug API Developer
My Photos
WOW, you are THE MAN. (except the syntax is (element, className), so I coded it as follows and it works great):
function delGallery() {
if(!YD.hasClass(document.body, 'homepage'))
return;
re = /\/(5144046_32NsP|5144110_myhEX)$/;
Now the third and final challenge: Is there any way to code this so I can list the "categories" to delete in the "re =" list instead of the "galleries"? In this case all of the galleries listed are in the same category, so it would be easier to maintain the list if by category.
Thanks for the snippet. Just what I needed.
(PS: Wonder if you could also take a peek at the problem I'm having here:
http://www.dgrin.com/showpost.php?p=856259&postcount=9
)
le pere de www.nikiwalkerphotography.com
Here's the updated Javascript:
// Delete certain galleries from the galleriesBox, meeting the following criteria:
// a) None when loggedIn.
// b) The galleries listed in the "re" variable, but only on the homepage.
// c) All empty galleries.
// The specific intent here is to delete from the homepage galleriesBox, all of the
// galleries for a certain category. In this case it is the Portfolio category, so all
// galleries in that category are listed in the "re" variable.
function delGallery() {
if (!YD.hasClass(document.body, 'loggedIn')) {
re = /\/(4958232_STy9F|4946254_R3Qcv|5144031_k2sVq|5144042_7gUQV|5144046_32NsP|5144110_myhEX)$/;
home = YD.hasClass(document.body, 'homepage');
re_empty = /\/(spacer.gif)$/;
var oList = YD.getElementsByClassName('miniBox', 'div', this);
for (i = 0; i < oList.length; i++) {
if (((re.test(oList.getElementsByTagName('a')[0].href)) && (home)) || (re_empty.test(oList.getElementsByTagName('img')[0].src))) {
oList.parentNode.removeChild(oList);
}
}
}
}
YE.onContentReady('galleriesBox', delGallery);
Still would like to know about doing it by listing categories instead of listing galleries.
le pere de www.nikiwalkerphotography.com
le pere de www.nikiwalkerphotography.com