Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Oct 2010
    Location
    Northern California
    Posts
    47

    Default Is there a Search function for a site?

    I haven't seen any examples or found any mention in my WD 11+ for adding a Search function to the site. It seems that if Google can find a page with a particular keyword, there must be a way to add that Search option to the home page. Any help would be great.

  2. #2
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,895

    Default Re: Is there a Search function for a site?

    You could try Googles
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  3. #3
    Join Date
    Jul 2015
    Location
    Currently New York State
    Posts
    774

    Default Re: Is there a Search function for a site?

    In Designer Pro 11 there is a Google search widget under the design gallery in the other widget folder. Not sure if this widget is in WD 11 if not you can also go to Google's site https://cse.google.com/cse/ to sign up and get the code to add a search function for your site.

    Here is a website that has code for Google, Bing or even Yahoo to setup a search box:
    http://www.developerdrive.com/2012/0...-your-website/
    You should be able to add this code to a place holder and have either one of these for your site.

    Hope this helps

    Ray

  4. #4
    Join Date
    Oct 2010
    Location
    Northern California
    Posts
    47

    Default Re: Is there a Search function for a site?

    Thank you both for the links. I've been testing them out but seems I'll need to wait until google indexes the site before it works. I also came across AddSearch.com, which seems ideal but very pricey. I tested out their search function which only took a few minutes to crawl and index my 10-page website. But it works like a charm in their limited-time demo.

    As for the Google search, I'm assuming it will have ads, but will wait to find out.

  5. #5
    Join Date
    Oct 2010
    Location
    Northern California
    Posts
    47

    Default Re: Is there a Search function for a site?

    Well, I finally made some progress, but could use a tip from a programmer.

    I put the search function at the top of my fan site, and it does work, but it works too well. It finds and returns every instance of the words even in the code. Which means that it will pull up pages with the term as a keyword or part of a menu option. If I enter "Spartacus" for instance, all the pages in my site get shown.

    So what I get is the same as if I entered: site:stanleykubrick.website spartacus

    But if I manually enter: site:stanleykubrick.website intitle:spartacus, which added the operator "intitle", it now gives me only pages with the word "Spartacus" as part of the title. That would work much better for my site. Is there some extra coding that I could add to my existing code to do that? The code I have now is:

    <form method="get" action="http://www.google.com/search">

    <div style="border:2px dotted black;padding:4px;width:15em;">
    <table border="0" align="center" cellpadding="0">
    <tr><td>
    <input type="text" name="spartacus" size="25" style="color:#808080;"
    maxlength="255" value="Google site search"
    onfocus="if(this.value==this.defaultValue)this.val ue=''; this.style.color='black';" onblur="if(this.value=='')this.value=this.defaultV alue; "/>

    <input type="submit" value="Go!" />
    <input type="hidden" name="sitesearch" value="stanleykubrick.website" /></td></tr>
    </table>
    </div>

    Thanks.

  6. #6
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,486

    Default Re: Is there a Search function for a site?

    Acorn came up with one a few years back. I am attaching a simple Xara .xar document that contains a placeholder that you can copy and paste onto your .web or .xar document. Just change the URL www.placitasartists.com link with your own site URL.

    If you like it and use it, be sure to thank Acorn (moderator here).

    Click on the link above to see the search in action. Do a search for Painting, or Priester and anything else.
    Attached Files Attached Files

  7. #7
    Join Date
    Oct 2010
    Location
    Northern California
    Posts
    47

    Default Re: Is there a Search function for a site?

    Unfortunately it didn't work either. All it changed was adding WWW in front of the site name, but which oddly gave me no results at all. I think I need the code to specify "intitle:" with the search term. But thanks for finding that alternative code.

  8. #8
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Default Re: Is there a Search function for a site?

    Here is the code that you would modify to get Gary's example to work as you need:

    <script type="text/javascript">
    //Enter domain of site to search.
    var domain="http://stanleykubrick.website" //replace this with your site domain


    function GoogleSiteSearch(cur){
    cur.q.value="site:"+domain+" intitle:"+cur.searchTerm.value
    }
    </script>


    <form action="http://www.google.com/search" method="get" target="_blank" onSubmit="GoogleSiteSearch(this)">
    <p><br /> <!--replace [[...]] with your details -->
    <input id="searchBox" name="searchTerm" type="text" style="width: 192px" /> <input type="submit" value="?" /></p>
    <input name="q" type="hidden" />
    </form>

    I would probably add a drop-down box to force include specific operators in http://www.googleguide.com/advanced_...reference.html like intitle:, rather that hard-code it.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Info Re: Is there a Search function for a site?

    for those of who prefer Google not to track us too much, I would use;

    <script type="text/javascript">
    //Enter domain of site to search.
    var domain="http://stanleykubrick.website" //replace this with your site domain


    function SiteSearch(cur){
    cur.q.value="site:"+domain+" intitle:"+cur.searchTerm.value
    }
    </script>


    <form action="http://duckduckgo.com" method="get" target="_blank" onSubmit="SiteSearch(this)">
    <p><br /> <!--replace [[...]] with your details -->
    <input id="searchBox" name="searchTerm" type="text" style="width: 192px" /> <input type="submit" value="?" /></p>
    <input name="q" type="hidden" />
    </form>

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  10. #10
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,895

    Default Re: Is there a Search function for a site?

    Excellent Acorn
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •