|
|
Thread Tools | Display Modes |
|
#1
|
|
|
Scripting dude-volunteer
|
Remove photo count from categories and sub-categories
A normal category and subcategory description shows both the number of galleries and the number of photos in those galleries like this:
![]() Using this customization, you can remove the number of photos so it just looks like this: ![]() To install this customization, just paste this code into your bottom javascript: Code:
// ----------------------------------------------------------------------------
// TrimCategoryPhotoCount
//
// Takes a category of subcategory description that would typically
// look like this:
//
// 1 gallery with 11 photos
// 4 galleries with 140 photos
//
// And changes it to remove the photo count so it just looks like this:
//
// 1 gallery
// 4 galleries
// ----------------------------------------------------------------------------
function TrimCategoryPhotoCount()
{
var miniBoxes = YD.getElementsByClassName("miniBox", "div", this);
for (var i = 0; i < miniBoxes.length; i++)
{
var descriptions = YD.getElementsByClassName("description", "p", miniBoxes[i]);
try
{
var match = descriptions[0].innerHTML.match(/^\d+ galler(y|ies)/);
descriptions[0].innerHTML = match[0];
} catch (e) {}
}
}
YE.onContentReady("categoriesBox", TrimCategoryPhotoCount);
YE.onContentReady("subcategoriesBox", TrimCategoryPhotoCount);
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
|
#2
|
|
|
Major grins
|
Very cool. Just one note: When combining this with the Display subcategories and galleries together hack, put this one first so the subcategory gets the photo count trimmed first.
|
|
|
|
|
#3
|
|
|
iF3000
|
worked for me!!!
|
|
|
|
|
#4
|
||
|
Big grins
|
Quote:
|
|
|
|
||
|
#5
|
|
|
Big grins
|
__________________
http://www.kelvinlohphotography.com |
|
|
|
|
#6
|
||
|
Scripting dude-volunteer
|
Quote:
YE.onContentReady("galleriesBox", TrimCategoryPhotoCount);
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#7
|
||
|
Big grins
|
Quote:
__________________
http://www.kelvinlohphotography.com |
|
|
|
||
|
#8
|
|
|
Major grins
|
Along these same lines, John, is there a way to get rid of the "updated February 28, 2010" garble? I only want the gallery title and number, nothing more.
Thanks, Rob EDIT: in fact, now that I look at it, I could do without any descriptions whatsoever, just the gallery title - if that's possible???
__________________
Nikon D90 | MB-D80 GRIP | 80-200mm F2.8 | 50mm F1.8 | Tamron 28-75mm F2.8 | SB 400 Pentax K1000 | M28mm F2.8 | M50mm F2 | Takumar Bayonet 135mm F2.5 www.southshoresnapshots.smugmug.com |
|
|
|
|
#9
|
||
|
Scripting dude-volunteer
|
Quote:
#category .miniBox p.updated {display:none;} This CSS gets rid of the description in the category view: #category .miniBox p.description {display:none;}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#10
|
|
|
Big grins
|
I used the above CSS to try and get rid of the gallery description and updated date. It worked for the albums once you open them from my main Galleries page, but I want to get rid of the same things on the Galleries page also. The below link shows the page where I want to get rid of that info. How do I do it?
http://ryanbphoto.smugmug.com/galleries |
|
|
|
|
#11
|
||
|
Scripting dude-volunteer
|
Quote:
.miniBox p.updated {display:none;} .miniBox p.description {display:none;}
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#12
|
|
|
Big grins
|
success!!
|
|
|
|
|
#13
|
|
|
Big grins
|
awesome! these "Collection of javascript customizations" are AMAZING! Thank you guys, you guys rule!
|
|
|
|
|
#14
|
|
|
Big grins
|
seems that' i cant' get this working as i just got the sub-gallery name (=NEW) but not the number of galleries within - any suggestions?
http://wegotit.smugmug.com/Music thanks t |
|
|
|
|
#15
|
||
|
Major grins
|
Quote:
Taking this thread as an example, I want only to show the number of photos in the category or subcategory. Example: airplanes=100 photos, nature=50 photos and so on. I have implemented the code, and for now it shows the number of galleries in each category...But I need only photos. Please advice, Regards, Ben
__________________
www.fotojcha.com |
|
|
|
||
|
#16
|
||
|
Scripting dude-volunteer
|
Quote:
var match = descriptions[0].innerHTML.match(/^\d+ galler(y|ies)/); to this: var match = descriptions[0].innerHTML.match(/\d+ photos?/);
__________________
--John Homepage • Popular JFriend's javascript customizations • Secrets for getting fast answers on Dgrin Always include a link to your site when posting a question |
|
|
|
||
|
#17
|
|
|
Major grins
|
It worked Thanks
It worked Thanks
__________________
www.fotojcha.com |
|
|
|
| Tell The World! | |
| Thread Tools | |
| Display Modes | |
|
|