Create a custom keyword search box

thenickdudethenickdude Registered Users Posts: 1,302 Major grins
edited May 20, 2014 in SmugMug Customization
This custom keyword search box allows you to add keywords to the user's query, or allow the user to pick keywords from a dropdown box instead of typing them in:

http://www.sherlockphotography.org/Customisations/Custom-site-search

You could also allow the user to select keywords using checkboxes or radio buttons, let me know if anybody wants an example of either of these.

Note that SmugMug recently added the ability to create a search box that only searches a specified gallery or folder, so if that's the only thing you're trying to do, you can use a regular SmugMug search content block instead.

Comments

  • leftquarkleftquark Registered Users, Retired Mod Posts: 3,784 Many Grins
    edited October 30, 2013
    I think you read my mind lamah. I just got back from photographing an ultramarathon and was about to code up something to do this ... I wanted to have a drop-down menu so runners could search for keywords that I tag with their bib number. I was going to do something *EXACTLY* like this. Glad you beat me to it -- makes my life slightly easier :)
    dGrin Afficionado
    Former SmugMug Product Team
    aaron AT aaronmphotography DOT com
    Website: http://www.aaronmphotography.com
    My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
  • rbrtrbrt Registered Users Posts: 21 Big grins
    edited May 20, 2014
    I was using SmugMug's search box, but wanted a way to allow people to buy photos off the search results page. Came across this thread in my search for a solution. I like SmugMug's search for limiting search to specific locations, but your solution works well enough by combining keywords. Thanks!

    Some cleanup of the results page. To remove keyword controls add the below to CSS:
    .sm-gallery-related-keywords {display:none !important;}
    .sm-gallery-combine-with {display:none !important;}
    .sm-gallery-remove-keywords {display:none !important;}

    Also, slight clarification on your tutorial. If hosting the script on a server, the user has to add URL/search.php to the action field. (do you have a redirect setup?)
Sign In or Register to comment.