• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support Legacy SmugMug Customization Help me hide gallery categories.

Need some help with your New SmugMug Site?

Dgrin Challenges

Our Challenges moderator has lined up an new set of challenges for you. The Weekly Word Challenge. Get all the details and participate in the conversation Weekly Word Challenge.

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

Looking for a little challenge? The Dgrin Mini-Challenges are a great way to challenge yourself. Take a moment to look through past winners and find the current Mini Challenge here.

From Around the Net

Enjoy a few of our favorite articles from around the 'net. If you have something you think we should see, post it here and we'll have a look.

Journeys

Landscapes

Sports

 
Thread Tools Display Modes
Old Aug-29-2009, 08:13 AM
#1
anonymouscuban is offline anonymouscuban OP
Inner Tube Pilot
anonymouscuban's Avatar
Help me hide gallery categories.
I have my site setup so there is an HTML landing page that has links to Gallery Categories. I had certain Gallery Categories hidden so that they could only be accessed from the HTML landing page. I logged into my site today and now all of the Gallery Categories are showing. It's been quite a long time since I created the site so I can't remember how to fix it so they're hidden.

Here is a link to my site: http://www.thesotelos.com/galleries

Basically, I want to hide all the Gallery Categories that start with the word Archive. Can you look at my code to see where it got screwed up?

Thanks for your help.

Alex
__________________
"I'm not yelling. I'm Cuban. That's how we talk."

Moderator of the People and Go Figure forums

My Smug Site
Old Aug-29-2009, 08:25 AM
#2
JoeSalmi is offline JoeSalmi
Ummm..
JoeSalmi's Avatar
Quote:
Originally Posted by anonymouscuban
I have my site setup so there is an HTML landing page that has links to Gallery Categories. I had certain Gallery Categories hidden so that they could only be accessed from the HTML landing page. I logged into my site today and now all of the Gallery Categories are showing. It's been quite a long time since I created the site so I can't remember how to fix it so they're hidden.

Here is a link to my site: http://www.thesotelos.com/galleries

Basically, I want to hide all the Gallery Categories that start with the word Archive. Can you look at my code to see where it got screwed up?

Thanks for your help.

Alex
when you are logged in go to that gallery and click customize, once inside the customizer scroll down until you see the "Privacy" area, make sure that your gallery has "Unlisted" marked and not public.
Old Aug-29-2009, 08:29 AM
#3
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by anonymouscuban
I have my site setup so there is an HTML landing page that has links to Gallery Categories. I had certain Gallery Categories hidden so that they could only be accessed from the HTML landing page. I logged into my site today and now all of the Gallery Categories are showing. It's been quite a long time since I created the site so I can't remember how to fix it so they're hidden.

Here is a link to my site: http://www.thesotelos.com/galleries

Basically, I want to hide all the Gallery Categories that start with the word Archive. Can you look at my code to see where it got screwed up?

Thanks for your help.

Alex
Ask jfriend if this can be added to this js to filter only those.
http://www.dgrin.com/showthread.php?p=1144549
__________________
Al - Just a volunteer here having fun :D
My Website my Blog
Mozilla Firefox Web Developer Firebug
Customization FAQ Banner/Navbar/Slideshow Tutor
Old Aug-29-2009, 08:41 AM
#4
anonymouscuban is offline anonymouscuban OP
Inner Tube Pilot
anonymouscuban's Avatar
Quote:
Originally Posted by Allen
Ask jfriend if this can be added to this js to filter only those.
http://www.dgrin.com/showthread.php?p=1144549
The strange thing Allen is that you helped me hide them a while back. Everything was fine until recently. Were there updates to SmugMug that disabled the JS you helped me add before to hide the categories?
__________________
"I'm not yelling. I'm Cuban. That's how we talk."

Moderator of the People and Go Figure forums

My Smug Site
Old Aug-29-2009, 09:54 AM
#5
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by anonymouscuban
The strange thing Allen is that you helped me hide them a while back. Everything was fine until recently. Were there updates to SmugMug that disabled the JS you helped me add before to hide the categories?
I think the letter "i" has to be added at the end, might try it.

..... hive%20Places|Archive%20Animals)$/;


..... hive%20Places|Archive%20Animals)$/i;

This came up in another thread other day.
__________________
Al - Just a volunteer here having fun :D
My Website my Blog
Mozilla Firefox Web Developer Firebug
Customization FAQ Banner/Navbar/Slideshow Tutor
Old Aug-29-2009, 12:32 PM
#6
jfriend is offline jfriend
Scripting dude-volunteer
First of all, it's the delCategory function in your bottom javascript that is responsible for hiding the categories. With the change the nice names for categories, the URL in the thumbnail changed to a nicer looking name and that's what delCategory was matching. If you want to remove all Archive Categories, then you can do this:

Change this line of code in the delCategory function from this:

Code:
re = /\/(Guest%20Book|Archive|Archive%20Family%20&%20Friends|Archive%20Events|Archive%20Random%20Stuff|Archive%20Places|Archive%20Animals)$/;
to this:

Code:
re = /\/Archive/;
Do you realize that you could have also just made all the galleries in those categories by unlisted and then the category wouldn't show for anyone except you. That's the built-in way to hide archive kinds of categories.
__________________
--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; Aug-29-2009 at 01:37 PM.
Old Aug-29-2009, 01:26 PM
#7
anonymouscuban is offline anonymouscuban OP
Inner Tube Pilot
anonymouscuban's Avatar
Quote:
Originally Posted by jfriend
First of all, it's the delCategory function in your bottom javascript that is responsible for hiding the categories. With the change the nice names for categories, the URL in the thumbnail changed to a nicer looking name and that's what delCategory was matching. If you want to remove all Archive Categories, then you can do this:

Change this line of code in the delCategory function from this:

Code:
re = /\/(Guest%20Book|Archive|Archive%20Family%20&%20Friends|Archive%20Events|Archive%20Random%20Stuff|Archive%20Places|Archive%20Animals)$/;
to this:

Code:
re = /\/Archive/
Do you realize that you could have also just made all the galleries in those categories by unlisted and then the category wouldn't show for anyone except you. That's the built-in way to hide archive kinds of categories.
That worked, thanks a million.

Regarding your suggestion of setting all the galleries to unlisted to hide the categories, I originally went that route but then they don't display at all when someone else view my page. What I wanted was to hide the category thumbs to keep that page clean. Then I created an HTML landing page which is accessed from a button in my toolbar. Once you are at the landing page, you can then link to the all the Archived galleries which are password protected.

Basically, I wanted two seperate category pages and this is the only way I could figure out how to do it. Does it make sense the way I did this or was there an easier method?

Alex
__________________
"I'm not yelling. I'm Cuban. That's how we talk."

Moderator of the People and Go Figure forums

My Smug Site
Old Aug-29-2009, 01:34 PM
#8
jfriend is offline jfriend
Scripting dude-volunteer
Quote:
Originally Posted by anonymouscuban
That worked, thanks a million.

Regarding your suggestion of setting all the galleries to unlisted to hide the categories, I originally went that route but then they don't display at all when someone else view my page. What I wanted was to hide the category thumbs to keep that page clean. Then I created an HTML landing page which is accessed from a button in my toolbar. Once you are at the landing page, you can then link to the all the Archived galleries which are password protected.

Basically, I wanted two seperate category pages and this is the only way I could figure out how to do it. Does it make sense the way I did this or was there an easier method?

Alex
I didn't realize you wanted other people to see the archive categories. If that's the case then, you can't go the unlisted route. This will work. The pattern you have now matches any category that starts with "Archive" so future Archive categories will match it too and will be hidden.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Aug-29-2009, 01:43 PM
#9
anonymouscuban is offline anonymouscuban OP
Inner Tube Pilot
anonymouscuban's Avatar
Quote:
Originally Posted by jfriend
I didn't realize you wanted other people to see the archive categories. If that's the case then, you can't go the unlisted route. This will work. The pattern you have now matches any category that starts with "Archive" so future Archive categories will match it too and will be hidden.
Cool. That will help a bunch. Before, I had the subcategories called out in the JS code so like you said, each time I added a new one or made a change, I had to update. This will be much easier.

You guys always rock. Thanks a bunch.
__________________
"I'm not yelling. I'm Cuban. That's how we talk."

Moderator of the People and Go Figure forums

My Smug Site
Old Sep-13-2009, 12:33 AM
#10
HaraldE is offline HaraldE
Digital Memories
HaraldE's Avatar
Friends,

I suffer deeply from the above described issue. For years I have hidden Categories and some weeks ago they were suddenly shown. And yes, I have now added the "i" as explained above. It still doesn't work. So I have walked through and made all galleries in these "hidden" categories unlisted for time being, which is not what I want.

In my Custom Footer I have at the top ...
Quote:
******** type="text/javascript" language="javascript">

function delCategory() {
re = /\/
(SH-Wedding|Pending|Strandberg|Photobooks|HomePage|Mix ed|Test|SOKQuest|Myrskaren|Cecilia|Sara|Axina|Anne Marie-Svante|Mikael|Family)$/i;

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);
</********
My site is HaraldE.Smugmug.com (also EngFam.com) and I have on purpose left a public gallery in HomePage category so it can show through.

Why aren't my Categories hidden?

All help appreciated
__________________
==================
My focus is on digitizing memories
Old Sep-13-2009, 05:59 AM
#11
jfriend is offline jfriend
Scripting dude-volunteer
Quote:
Originally Posted by HaraldE
Friends,

I suffer deeply from the above described issue. For years I have hidden Categories and some weeks ago they were suddenly shown. And yes, I have now added the "i" as explained above. It still doesn't work. So I have walked through and made all galleries in these "hidden" categories unlisted for time being, which is not what I want.

In my Custom Footer I have at the top ...

My site is HaraldE.Smugmug.com (also EngFam.com) and I have on purpose left a public gallery in HomePage category so it can show through.

Why aren't my Categories hidden?

All help appreciated
You have three javascript errors that are keeping things from working:

1) This code in your top javascript is not javascript (it's CSS). Remove it from your top javascript as it is causing errors and preventing all other code from working:

/* This code will turn off the caption below and turn on the caption above: */
#caption_top {
display: block;
}
#caption_bottom {
display: none;
}

2) This code in your top javascript must all be on one line and cannot have a linebreak in the middle of it.

re = /\/ (SH-Wedding|Pending|Strandberg|Photobooks|HomePage|Mix ed|Test|SOKQuest|Myrskaren|Cecilia|Sara|Axina|Anne Marie-Svante|Mikael|Family)$/i;

3) You have this code that is calling the hasPath function, but you don't have that function declared anywhere. You must either delete this code or add the hasPath function as show in the galleries page tutorial:

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

After you've fixed those three errors, we can see if you have any more that also need fixing.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Sep-13-2009, 08:42 AM
#12
HaraldE is offline HaraldE
Digital Memories
HaraldE's Avatar
Hidden categories not hidden
Hello Friend,

Quote:
1) This code in your top javascript is not javascript (it's CSS). Remove it from your top javascript as it is causing errors and preventing all other code from working:
Code deleted

Quote:
2) This code in your top javascript must all be on one line and cannot have a linebreak in the middle of it.

re = /\/ (SH-Wedding|Pending|Strandberg|Photobooks|HomePage|Mix ed|Test|SOKQuest|Myrskaren|Cecilia|Sara|Axina|Anne Marie-Svante|Mikael|Family)$/i;
That is one line ... and the code is actually in the Custom Footer, not in top javascript ... if it matters

Quote:
3) You have this code that is calling the hasPath function, but you don't have that function declared anywhere. You must either delete this code or ...
Code deleted

I also removed some other code while at it ... either because I didn't know what it was or decided I could live without it.

But I still have same problem. When using "Visitor's View" I can see the category "HomePage" and while I am myslf I see all the "hidden" categories listed.

I am prepared to remove any other code just to get this thing working. To be able to hide categories is a cornerstone in my use of SmugMug.
__________________
==================
My focus is on digitizing memories
Old Sep-13-2009, 09:02 AM
#13
jfriend is offline jfriend
Scripting dude-volunteer
Quote:
Originally Posted by HaraldE
Hello Friend,

Code deleted


That is one line ... and the code is actually in the Custom Footer, not in top javascript ... if it matters

Code deleted

I also removed some other code while at it ... either because I didn't know what it was or decided I could live without it.

But I still have same problem. When using "Visitor's View" I can see the category "HomePage" and while I am myslf I see all the "hidden" categories listed.

I am prepared to remove any other code just to get this thing working. To be able to hide categories is a cornerstone in my use of SmugMug.
OK, we're down to just one error now. This code in your custom footer is not right. Everything shown in red below needs to be on one line because the way it is is causing an error. You need to remove the linebreak in the middle. If you don't believe that red code is multiple lines, do a View Source on the page in your browser and see for yourself.

Code:
<script type="text/javascript" language="javascript">

function delCategory() {
re = /\/
(SH-Wedding|Pending|Strandberg|Photobooks|HomePage|Mixed|Test|SOKQuest|Myrskaren|Cecilia|Sara|Axina|AnneMarie-Svante|Mikael|Family)$/i;

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);
</script>
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Sep-13-2009, 12:40 PM
#14
HaraldE is offline HaraldE
Digital Memories
HaraldE's Avatar
Thanks John,

I think we are on to something here. First I still believe this has been one line all the time. But you made me look at the line a bit closer and then I started to experiment.

First I removed any blanks in the line. Not good enough.

And then I thought about the new NN facility recently added. And there are two categories on the line with blanks in them. Earlier I had these as %20 to simulate a blank. So I changed both to - (hyphen, since I had read somewhere about NN wanted - instead of blank) ... still not good.

I changed both of them back to %20 ... no good

Then I thought about these two categories and realised one was old and one was new ... from late August. So I use %20 in the old one and - in the new one ... bingo.

This is the way my line looks right now ...
Quote:
function delCategory() {
re=/\/(SH-Wedding|Pending|Strandberg|Photobooks|HomePage|Mix ed|Test|SOKQuest|Myrskaren|Cecilia|Sara|Axina|Anne Marie%20Svante|Mikael|Family)$/i;

(I know you will tell me there are still 2 blanks in the line ... but this is not true ... they are not there ... when I paste the line in here they get added and I can not avoid it)
... and it works ... as least as far as I have had time to test.

When I use Visitotr's View I see none of these categories ... where I earlier saw HomePage, and when I am myself I also see none. And this is what I had before and this is what I want.

If you now could just tell me what is going on I would be most greatfull ... I am confused?
__________________
==================
My focus is on digitizing memories
Old Sep-13-2009, 03:04 PM
#15
jfriend is offline jfriend
Scripting dude-volunteer
Quote:
Originally Posted by HaraldE
Thanks John,

I think we are on to something here. First I still believe this has been one line all the time. But you made me look at the line a bit closer and then I started to experiment.

First I removed any blanks in the line. Not good enough.

And then I thought about the new NN facility recently added. And there are two categories on the line with blanks in them. Earlier I had these as %20 to simulate a blank. So I changed both to - (hyphen, since I had read somewhere about NN wanted - instead of blank) ... still not good.

I changed both of them back to %20 ... no good

Then I thought about these two categories and realised one was old and one was new ... from late August. So I use %20 in the old one and - in the new one ... bingo.

This is the way my line looks right now ...

... and it works ... as least as far as I have had time to test.

When I use Visitotr's View I see none of these categories ... where I earlier saw HomePage, and when I am myself I also see none. And this is what I had before and this is what I want.

If you now could just tell me what is going on I would be most greatfull ... I am confused?
The errors are finally gone (which is why some are working). I have no idea where these galleries are in your site (you have a lot of places to look).

If you have one that isn't working and you can supply the link to it, I can tell you why, but I don't honestly know what you want me to look at at this point. These values in this function need to match the nice name that the category has in it's URL. If it previously had a space in it (which required %20), it probably now has a dash in it which can just be expressed as a dash, but you control the nice name for each category/sub-category/gallery now so you can make it whatever you want. Whatever you make it is what will appear in the URL and is what will need to be in this function.
__________________
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Sep-13-2009, 03:33 PM
#16
HaraldE is offline HaraldE
Digital Memories
HaraldE's Avatar
All Lights Green
Thanks John,

Your help has been very good ... your light has shown me the way out of the dark forrest and I am very glad. Some further testing tells me the Hidden Categories are back in business.

I am most gratefull
__________________
==================
My focus is on digitizing memories
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