Hide some keywords from home page
richpepp
Registered Users Posts: 360 Major grins
Dear folks
Does anyone know if it is possible to exclude some keywords from the top 100 keywords on the home page? I really like that feature but I also tag most of my photos with a technical reference that I would prefer not to show up simply because it isn't interesting. A lot of photos will have the same technical tag so these always appear more important than they really are.
I suspect another solution is to use galleries with the same technical name but I was trying to avoid that.
Good luck to all
Richard
Does anyone know if it is possible to exclude some keywords from the top 100 keywords on the home page? I really like that feature but I also tag most of my photos with a technical reference that I would prefer not to show up simply because it isn't interesting. A lot of photos will have the same technical tag so these always appear more important than they really are.
I suspect another solution is to use galleries with the same technical name but I was trying to avoid that.
Good luck to all
Richard
0
Comments
Hi Richard
There is not a way to exclude certain keywords. The keywords are listed alphabetically. Maybe you could come up with a way to have the keywords you wish to be excluded towards the end, and then simply show the top 25 or 50 keywords on the home page. Probably not ideal for you, but an idea, anyway
Smug since 2006
SmugMug Help
PhotoscapeDesign
What type of smugmug account do you have ?
Cheers,
David
SmugMug API Developer
My Photos
Hi Barb
Good trick but I think that the keywords appear in the list according to how frequent they are and the keywords I want to exclude will always be high on that list.
thanks though
Pro
If you want to take a look we are at http://miseast.smugmug.com/ and the sorts of codes we are trying to remove are things like 'afgtfb001' which are our project codes. We use them when we link in from our main site so you can see the photos for a particular project but they aren't much fun when you are starting at the top of the photo site and just browsing through the pics.
tx
Rich
I think i should be able to come up with a solution, but it's way to late here.
I will try to put something together tomorrow.
Cheers,
David
SmugMug API Developer
My Photos
www.ivarborst.nl & smugmug
to remove keywords, replace words in yellow; values must be in quotes and separated by a comma.
Javascript block: footer block (remove the *'s): Cheers,
David
SmugMug API Developer
My Photos
I tried it and had one problem. On this line of code:
Educate me, please....
hehe, sorry cut and paste bug
SmugMug API Developer
My Photos
Just for my info is there an easy answer to the questions:
What is YD? (oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
)
Has 'oKeywords' already been declared somewhere?
Thanks again, it does exactly what I was looking for - I hope it didn't take too long to work out. I wouldn't have stood a chance
Richard
var oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
YD is an alias to YAHOO.util.Dom, which is part of a yahoo framework that is plugged into SM now.
You can read more about it here.
Cheers,
David
SmugMug API Developer
My Photos
Cool, thanks. The more you get into this the more you realise that just about anything is possible.... (-ish). In hunting for solutions for this on the forum I came across a ton of stuff which makes me extremely glad I went for smugmug in the end.:D It's now going to be a battle between my imagination and my knowledge to see which can get up to speed faster.
tx + thanks again for the solution
Rich
Edited so complete code shows. Allen
www.ivarborst.nl & smugmug
I just tried this and it works great. BUT, before I go too far let me ask about the rest of the plan.
I have over 100 boat brand names that I want to suppress from the keywords listing. This looks to work fine for that part.
Now, I want to create a search-by-brand-name capability that will create a virtual gallery. My original intention was to simply tag the brand-name-image with ...../keyword/sea+ray for example.
Is that going to work in light of the fact that I am suppressing the 'sea ray' keyword? If not, how can I accomplish this?
http://blue-dog.smugmug.com
http://smile-123.smugmug.com
http://vintage-photos.blogspot.com/
Canon 7D, 100-400L, Mongoose 3.5, hoping for a 500L real soon.
http://blue-dog.smugmug.com
http://smile-123.smugmug.com
http://vintage-photos.blogspot.com/
Canon 7D, 100-400L, Mongoose 3.5, hoping for a 500L real soon.
Does this still work? I tried it and it doesn't seem to be working...
Edited to display complete code.
Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
Anybody??
Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
RichP
if (YD.hasClass(document.body,'homepage') && !YD.hasClass(document.body,'galleries')) {
removeKeywords();
}
with the script tags either side of course
Good luck
Richard
Half the code is missing when I view this in the forum. I went to the archive and I can see it all
http://www.dgrin.com/archive/index.php/t-45195.html
Now it works
Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
the code b0rked it from showing. Put bold brackets around them and they now show.
My Website index | My Blog
David,
Your original code works great!
How would one modify it to accept wildcards in the aKeywords list?
-Bob
http://designphotography.smugmug.com
When a gallery is unlisted, the keyword counts should account for keywords appearing in unlisted galleries. Ie, if a keyword only exists in an unlisted gallery, then it definitely should not appear in the Top 100 keywords....or perhaps an optional filter can be placed on the keywords...an "unlisted" filter.
I started using this hiding the keywords method and it works great! Thank you!
BUT -
It is quirky in a way I'm not sure it is supposed to be. So when my home page load, as it's loading ALL keywords appear. When it finishes loading, depending on the connection 2-10 seconds, THEN the keywords disappear and the whole page adjusts to that. I hope that makes sense - if you go to my page you'll seen exactly what I mean.
Is this how it should be or should it be instantaneous? What could be incorrect?
Thank you so much!
- Jeremy
I can think of two options. First, you can try triggering the script a bit earlier. Instead of triggering it with this in your footer:
<script>
removeKeywords();
</script>Try, removing that from your custom footer and putting this in your top javascript:
YE.onContentAvailable("keywordList", removeKeywords);
If that doesn't significantly improve things, then the best option may be to hide it in your CSS (so it does not initially show) and then show it with your javascript function after you've removed the keywords. That would guarentee that it never shows before you've removed the keywords you don't want in there.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
i've pasted all of the below into the bottom javascript.
is this all correct? many thanks! Jay
function removeKeywords() {
var aKeywords = ;
var oBox = YD.get('keywordsBox');
oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
for (i=0; i<oKeywords.length; i++) {
for (j=0; j<aKeywords.length; j++) {
if (aKeywords[j] == oKeywords.innerHTML) {
try {
oKeywords.parentNode.removeChild(oKeywords.previousSibling);
} catch(e){}
try {
oKeywords.parentNode.removeChild(oKeywords.nextSibling);
} catch(e){}
try {
oKeywords.parentNode.removeChild(oKeywords.nextSibling);
} catch(e){}
try {
oKeywords.parentNode.removeChild(oKeywords);
} catch(e){}
break;
}
}
}
}
footer block
********>
removeKeywords();
</********
If you're automatically going to extract keywords from a file name there's going to be TONS of words you don't want in there on the homepage!!
My request please::::
- First, please offer an option NOT to extract the keywords from the file names.
- 2nd, pls design some easy to use interface to select the words you want & hide the ones you don't.
My 2 cents
<script>
if (!YD.hasClass(document.body, "notLoggedIn"))
{removeKeywords();}
</script>
Edit: Looks like I need this instead, reverse logic?
"loggedIn"
My Website index | My Blog
if (!YD.hasClass(document.body, "notLoggedIn"))
will operate only when logged in. If you want something that operates only when not logged in, remove the ! sign
if (YD.hasClass(document.body, "notLoggedIn"))
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question