• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Remove photo count from categories and sub-categories

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Old Jul-25-2009, 10:49 AM
#1
jfriend is online now jfriend OP
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);
There is an older version of this script floating around that was written by someone else, but it generates errors in some circumstances. This one should work better.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Nov-15-2009, 11:30 AM
#2
claudermilk is offline claudermilk
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.
__________________
Chris
http://www.chrislaudermilkphoto.com/
Old Dec-11-2009, 07:32 AM
#3
Isaac is offline Isaac
iF3000
Isaac's Avatar
worked for me!!!
Old Dec-13-2009, 06:36 PM
#4
WaRom is offline WaRom
Big grins
Quote:
Originally Posted by jfriend
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);
There is an older version of this script floating around that was written by someone else, but it generates errors in some circumstances. This one should work better.
Works for me!! WooHoo
__________________
WaRom
Photos: http://www.gr-images.com
Old Jan-14-2010, 01:55 PM
#5
creativewedding is offline creativewedding
Big grins
Hi John,

I have inserted the codes but it didn't seem to work.

http://kelvinloh.smugmug.com/Travel
Old Jan-14-2010, 02:06 PM
#6
jfriend is online now jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by creativewedding
Hi John,

I have inserted the codes but it didn't seem to work.

http://kelvinloh.smugmug.com/Travel
That's because you are using the script that combines galleries and sub-categories so the sub-category thumbs have been moved and are not where they normally are. You can try adding this line to the end of your bottom javascript and see if it works then:

YE.onContentReady("galleriesBox", TrimCategoryPhotoCount);
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Jan-14-2010, 02:15 PM
#7
creativewedding is offline creativewedding
Big grins
Quote:
Originally Posted by jfriend
That's because you are using the script that combines galleries and sub-categories so the sub-category thumbs have been moved and are not where they normally are. You can try adding this line to the end of your bottom javascript and see if it works then:

YE.onContentReady("galleriesBox", TrimCategoryPhotoCount);
Thanks John! It worked.
Old Mar-14-2010, 08:24 AM
#8
South Shore Snapshots is offline South Shore Snapshots
Major grins
South Shore Snapshots's Avatar
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
Old Mar-14-2010, 04:37 PM
#9
jfriend is online now jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by South Shore Snapshots
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???
This CSS gets rid of the updated line:

#category .miniBox p.updated {display:none;}

This CSS gets rid of the description in the category view:

#category .miniBox p.description {display:none;}
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old May-25-2011, 12:01 PM
#10
RyanB is offline RyanB
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
Old May-25-2011, 12:16 PM
#11
jfriend is online now jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by RyanB View Post
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
If you want to get rid of the info everywhere, then use this CSS instead:

.miniBox p.updated {display:none;}
.miniBox p.description {display:none;}
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old May-31-2011, 02:49 PM
#12
fourlegsrgood is offline fourlegsrgood
Big grins
success!!
Quote:
Originally Posted by jfriend View Post
If you want to get rid of the info everywhere, then use this CSS instead:

.miniBox p.updated {display:none;}
.miniBox p.description {display:none;}
That worked for me. YAY.
Old Jul-04-2011, 08:55 AM
#13
StosPhotography is offline StosPhotography
Big grins
awesome! these "Collection of javascript customizations" are AMAZING! Thank you guys, you guys rule!
Old Oct-29-2011, 02:06 AM
#14
wegotit is offline wegotit
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
Old Nov-22-2011, 12:33 PM
#15
rocaver is offline rocaver
Major grins
Quote:
Originally Posted by wegotit View Post
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
Hi jfriend:

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
Old Nov-22-2011, 12:38 PM
#16
jfriend is online now jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by rocaver View Post
Hi jfriend:

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
In the script, try changing this line from this:

var match = descriptions[0].innerHTML.match(/^\d+ galler(y|ies)/);

to this:

var match = descriptions[0].innerHTML.match(/\d+ photos?/);
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Nov-22-2011, 01:31 PM
#17
rocaver is offline rocaver
Major grins
It worked Thanks
Quote:
Originally Posted by jfriend View Post
In the script, try changing this line from this:

var match = descriptions[0].innerHTML.match(/^\d+ galler(y|ies)/);

to this:

var match = descriptions[0].innerHTML.match(/\d+ photos?/);
It worked Thanks
__________________
www.fotojcha.com
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump