Options

Hide some keywords from home page

richpepprichpepp Registered Users Posts: 360 Major grins
edited March 26, 2010 in SmugMug Support
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
«1

Comments

  • Options
    BarbBarb Administrators Posts: 3,352 SmugMug Employee
    edited October 18, 2006
    richpepp wrote:
    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

    Hi Richard wave.gif

    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 :)
    Barb
    Smug since 2006
    SmugMug Help
    PhotoscapeDesign
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 18, 2006
    Richard,

    What type of smugmug account do you have ?

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited October 18, 2006
    Barb wrote:
    Hi Richard wave.gif

    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 :)

    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
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited October 18, 2006
    devbobo wrote:
    Richard,

    What type of smugmug account do you have ?

    Cheers,

    David

    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
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 18, 2006
    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
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    ivarivar Registered Users Posts: 8,395 Major grins
    edited October 18, 2006
    devbobo wrote:
    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
    clap.gifclapclap.gif dev to the rescue!
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 19, 2006
    ok...here's the function...

    to remove keywords, replace words in yellow; values must be in quotes and separated by a comma.

    Javascript block:
    function removeKeywords() {
    
     var aKeywords = [[COLOR=Yellow]'introversion','david parry'[/COLOR]];
    
     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[i].innerHTML) {
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i]);
           } catch(e){}
           break;
         }
       }
     }
    }
    
    footer block (remove the *'s):
    <[B][COLOR=Red]*[/COLOR][/B]script[B][COLOR=Red]*[/COLOR][/B]>
    removeKeywords();
    <[B][COLOR=Red]*[/COLOR][/B]/script[B][COLOR=Red]*[/COLOR][/B]>
    
    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    richWrichW Registered Users Posts: 941 Major grins
    edited October 19, 2006
    David, You amaze me....<img src="https://us.v-cdn.net/6029383/emoji/bowdown.gif&quot; border="0" alt="" >
    I tried it and had one problem. On this line of code:
    [LEFT]<[B][COLOR=red]*[/COLOR][/B]script[B][COLOR=red]*[/COLOR][/B]>[/LEFT]
    removeKeywords() {
    <[B][COLOR=red]*[/COLOR][/B]/script[B][COLOR=red]*[/COLOR][/B]>
     
     
     
    
    
    It wouldn't work until I changed the { to ;
    Educate me, please....
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 19, 2006
    richW wrote:
    David, You amaze me....<img src="https://us.v-cdn.net/6029383/emoji/bowdown.gif&quot; border="0" alt="" >
    I tried it and had one problem. On this line of code:
    [LEFT]<[B][COLOR=red]*[/COLOR][/B]script[B][COLOR=red]*[/COLOR][/B]>[/LEFT]
     removeKeywords() {
    <[B][COLOR=red]*[/COLOR][/B]/script[B][COLOR=red]*[/COLOR][/B]>
     
     
     
    
    
    It wouldn't work until I changed the { to ;
    Educate me, please....

    hehe, sorry cut and paste bug :D
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    richWrichW Registered Users Posts: 941 Major grins
    edited October 19, 2006
    Great work David..
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited October 19, 2006
    David - that is outrageous and works perfectly - thank you bowdown.gif

    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 wings.gif - I hope it didn't take too long to work out. I wouldn't have stood a chance

    Richard
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 19, 2006
    richpepp wrote:
    What is YD? (oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
    )


    Has 'oKeywords' already been declared somewhere?
    actually to be technically correct I should have made it this...

    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
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited October 19, 2006
    devbobo wrote:
    actually to be technically correct I should have made it this...

    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

    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
  • Options
    ivarivar Registered Users Posts: 8,395 Major grins
    edited October 19, 2006
    devbobo wrote:
    ok...here's the function...

    to remove keywords, replace words in yellow; values must be in quotes and separated by a comma.

    Javascript block:
    function removeKeywords() {
    
     var aKeywords = [[COLOR=Yellow]'introversion','david parry'[/COLOR]];
    
     var oBox = YD.get('keywordsBox');
     oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
    
     for (i=0; i[B]<[/B]oKeywords.length; i++) {
       for (j=0; j[B]<[/B]aKeywords.length; j++) {
         if (aKeywords[j] == oKeywords[i].innerHTML) {
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i]);
           } catch(e){}
           break;
         }
       }
     }
    }
    
    footer block
    <[B]s[/B]cript>
    removeKeywords();
    [B]<[/B]/[B]s[/B]cript>
    
    Cheers,

    David
    <img src="https://us.v-cdn.net/6029383/emoji/bowdown.gif&quot; border="0" alt="" >bow<img src="https://us.v-cdn.net/6029383/emoji/bowdown.gif&quot; border="0" alt="" >

    Edited so complete code shows. Allen
  • Options
    largelylivinlargelylivin Registered Users Posts: 561 Major grins
    edited October 18, 2007
    OK. Before I go too far......
    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?
    Brad Newby

    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.
  • Options
    largelylivinlargelylivin Registered Users Posts: 561 Major grins
    edited October 18, 2007
    never mind. I tested it and it does work, i don't understand why but it does.
    Brad Newby

    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.
  • Options
    jasonscottphotojasonscottphoto Registered Users Posts: 711 Major grins
    edited June 16, 2008
    devbobo wrote:
    ok...here's the function...

    to remove keywords, replace words in yellow; values must be in quotes and separated by a comma.

    Javascript block:
    function removeKeywords() {
    
     var aKeywords = [[COLOR=Yellow]'introversion','david parry'[/COLOR]];
    
     var oBox = YD.get('keywordsBox');
     oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
    
     for (i=0; i[B]<[/B]oKeywords.length; i++) {
       for (j=0; j[B]<[/B]aKeywords.length; j++) {
         if (aKeywords[j] == oKeywords[i].innerHTML) {
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i]);
           } catch(e){}
           break;
         }
       }
     }
    }
    
    footer block
    <[B]s[/B]cript>
    removeKeywords();
    [B]<[/B]/[B]s[/B]cript>
    
    Cheers,

    David

    Does this still work? I tried it and it doesn't seem to be working...

    Edited to display complete code.
    Posts by Allyson, the wife/assistant...

    Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
  • Options
    jasonscottphotojasonscottphoto Registered Users Posts: 711 Major grins
    edited June 16, 2008
    Does this still work? I tried it and it doesn't seem to be working...

    Anybody??
    Posts by Allyson, the wife/assistant...

    Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited June 17, 2008
    It still seems to be working for me as far as I can see

    RichP
  • Options
    richpepprichpepp Registered Users Posts: 360 Major grins
    edited June 17, 2008
    Actually I just checked my code again and it seems as if the footer has changed to:


    if (YD.hasClass(document.body,'homepage') && !YD.hasClass(document.body,'galleries')) {
    removeKeywords();
    }



    with the script tags either side of course :)

    Good luck

    Richard
  • Options
    jasonscottphotojasonscottphoto Registered Users Posts: 711 Major grins
    edited June 17, 2008
    Does this still work? I tried it and it doesn't seem to be working...

    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 :)
    Posts by Allyson, the wife/assistant...

    Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
  • Options
    AllenAllen Registered Users Posts: 10,011 Major grins
    edited June 17, 2008
    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 :)
    The complete code now shows above. With html on for this forum the <'s in
    the code b0rked it from showing. Put bold brackets around them and they now show.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    SystemSystem Registered Users Posts: 8,186 moderator
    edited December 28, 2008
    devbobo wrote:
    ok...here's the function...

    to remove keywords, replace words in yellow; values must be in quotes and separated by a comma.

    Javascript block:
    function removeKeywords() {
     
     var aKeywords = [[COLOR=yellow]'introversion','david parry'[/COLOR]];
     
     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[i].innerHTML) {
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
           } catch(e){}
           try {
             oKeywords[i].parentNode.removeChild(oKeywords[i]);
           } catch(e){}
           break;
         }
       }
     }
    }
    
    footer block (remove the *'s):
    <[B][COLOR=red]*[/COLOR][/B]script[B][COLOR=red]*[/COLOR][/B]>
    removeKeywords();
    <[B][COLOR=red]*[/COLOR][/B]/script[B][COLOR=red]*[/COLOR][/B]>
    
    Cheers,

    David

    David,
    Your original code works great!
    How would one modify it to accept wildcards in the aKeywords list?

    -Bob
    http://designphotography.smugmug.com
  • Options
    hammockhammock Registered Users Posts: 7 Beginner grinner
    edited December 29, 2008
    BobKane wrote:
    David,
    Your original code works great!
    How would one modify it to accept wildcards in the aKeywords list?

    -Bob
    http://designphotography.smugmug.com
    Another idea...

    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.
  • Options
    jasherjasher Registered Users Posts: 3 Beginner grinner
    edited January 28, 2009
    Hi there! My page is: photos.jasherphotography.com (jasher.smugmug.com)

    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
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited January 28, 2009
    jasher wrote:
    Hi there! My page is: photos.jasherphotography.com (jasher.smugmug.com)

    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.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    jaybo234jaybo234 Registered Users Posts: 4 Beginner grinner
    edited February 8, 2009
    remove keywords code not working
    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();
    </********
  • Options
    jaybo234jaybo234 Registered Users Posts: 4 Beginner grinner
    edited February 8, 2009
    May I suggest that this issue of removing unwanted keywords be addressed in a better way?
    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 =)
  • Options
    AllenAllen Registered Users Posts: 10,011 Major grins
    edited June 20, 2009
    Will this work so only if logged in they show?

    <script>
    if (!YD.hasClass(document.body, "notLoggedIn"))
    {removeKeywords();}
    </script>

    Edit: Looks like I need this instead, reverse logic?

    "loggedIn"
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited June 20, 2009
    Allen wrote:
    Will this work so only if logged in they show?

    <script>
    if (!YD.hasClass(document.body, "notLoggedIn"))
    {removeKeywords();}
    </script>

    Edit: Looks like I need this instead, reverse logic?

    "loggedIn"

    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"))
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.