Welcome to TalkGraphics.com
Results 1 to 10 of 16

Hybrid View

  1. #1
    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.

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,879

    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

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,879

    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

  4. #4
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,932

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

    Excellent Acorn
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

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

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

    It worked! Thanks. It pulled up only pages that had the search term in the title. But like a typical newbie, I then realized that people might also search for words not part of the film name, and that I had now excluded everything else. So I ended up going full circle by just using the WD widget for Google search.

    Since this is my own fan site, no harm done and the time spent was a learning experience. I actually only do fan-type sites like this for myself, and have never done a site for anyone else besides my wife, since WD makes them simple. I really appreciate the feedback and solution.

 

 

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
  •