• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Using different CSS rules for unlisted galleries

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 Aug-23-2010, 06:57 PM
#1
jfriend is online now jfriend OP
Scripting dude-volunteer
Using different CSS rules for unlisted galleries
[[Sorry, but this script is currently not working. I'm investigating whether there is a new way to do this or not.]]

Upon occasion, there is a need to use different CSS depending upon whether a gallery is unlisted or not. In particular, one site owner wants to hide the Facebook and Twitter buttons for unlisted galleries, but still leave the Easy Sharing button enabled. Unfortunately, Smugmug does not include any CSS tags to indicate whether the gallery is unlisted or not. This customization will add such a tag. To use this customization do the following two steps:

Step 1 - add javascript code

Copy this javascript to your bottom javascript:

Code:
YE.onContentReady("breadCrumbTrail", function() 
{
    var privates = Sizzle(".galleryPage #breadCrumbTrail .private");
    if (privates.length != 0)
    {
        YD.addClass(document.body, "unlistedGallery");
    }
    else if (YD.hasClass(document.body, "galleryPage"))
    {
        YD.addClass(document.body, "publicGallery");
    }
});

Step 2
- add appropriate CSS

Add whatever CSS you want to use. The script will add a class to the body tag called "unlistedGallery" if the current page is a gallery page and the gallery is unlisted. The script will add a class to the body tag called "publicGallery" if the current page is a gallery page and the gallery is not unlisted. Password protected galleries will also be labeled publicGallery.


For example, if you want to allow the Sharing button to display in an unlisted galery (so you've enabled Easy Sharing in Gallery Settings), but you want to hide the Twitter and Facebook buttons because they make it to easy to inadvertently disclose an unlisted gallery, you would follow Step 1 above and then add this CSS to your advanced customization:

#quickShare {display: none;}
.publicGallery #quickShare {display: block;}

This will hide the quickShare buttons by default, but show them if it's a public gallery.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Last edited by jfriend; Oct-25-2010 at 07:41 PM.
Old Aug-25-2010, 12:06 AM
#2
mikelane84 is offline mikelane84
Big grins
Say I want to use your example; where do I insert the last two lines of code?
Old Aug-25-2010, 04:55 AM
#3
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by mikelane84 View Post
Say I want to use your example; where do I insert the last two lines of code?
Are you referrng to this?
#quickShare {display: none;}
.publicGallery #quickShare {display: block;}

Goes in the CSS box on the customize page in your control panel.
Under customize tab.
Advanced Customizer > Site-wide.
Tell The World!  
Similar Threads Thread Starter Forum Replies Last Post
Show only specific galleries without unlisting Zoomdak SmugMug Customization 2 Feb-02-2010 05:59 AM
Galleries and Categories... Need help Dwass SmugMug Customization 3 Dec-02-2009 07:10 AM
Galleries re-arrange themselves, sharegroups revealing invisible galleries... Matthew Saville SmugMug Support 6 May-06-2006 11:21 PM
galleries linked to Community loosing customization dmc SmugMug Support 4 Apr-11-2006 10:35 AM
CSS Tools question jfriend SmugMug Customization 2 Oct-24-2005 01:28 PM


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