We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    Simple Site works for files in the root; search for a term and the 'results' page (which also lives in the site root) displays them. All good. But when searching from pages that live in sub-folders, e.g., 'file 1',

    Site Root
    > search results page
    >> Folder 1
    >>> file 1

    Simple Search looks for the results page in 'Folder 1' instead of the site root which doesn't work.

    Is there a way to always make it look for the results page in the site root or do I need to add a separate results page in every folder of the site?

    Thanks
      Todd
    • Are you using &landing to specify the results page id?

      [[!SimpleSearchForm? &tpl=`SearchFormTpl` &landing=`12` &hideMenu=`2`]]


      .
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 40088
        • 708 Posts
        Quote from: frogabog at Sep 27, 2012, 08:09 PM
        Are you using &landing to specify the results page id?

        I am,

        [[!SimpleSearchForm? &landing=`51` &tpl=`mySearchForm`]]


        id 51 is in the site root.
          Todd
        • Does it fail to locate id 51? What happens? That's quirky if you ask me. It shouldn't matter where the resource is located since it's being specified.

          Now you got me wondering... I have to admit I haven't bothered to search from a child page while testing SimpleSearch.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 40088
            • 708 Posts
            Quote from: frogabog at Sep 27, 2012, 09:50 PM
            Does it fail to locate id 51? What happens? That's quirky if you ask me. It shouldn't matter where the resource is located since it's being specified.

            Using the above file structure as an example, the (incorrect) search results url would be,

            http://mysite.com/Folder1/search-results

            when it should be

            http://mysite.com/search-results

            Strange, right?

            This issue is similar to the ones I get when using Wayfinder in sub-directories, but that's another matter.
              Todd
            • Hm. I cannot reproduce the error. It always goes to the correct page.

              What version of MODx? SimpleSearch?

              What are your system_settings for Friendly URLs? Do you have any plugins installed that meddle with URLs? Is your .htaccess file modified from the original?

                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 40088
                • 708 Posts
                Revo v2.2.4
                SS v1.6.0

                Here are my FURL settings:

                http://tinyurl.com/99envvg

                http://tinyurl.com/8zkzuhm


                Not sure about other plugins that might monkey around with urls:

                http://tinyurl.com/9kq9zsn

                http://tinyurl.com/8fnyv6h


                htaccess uses only minimal default settings.
                  Todd
                • I don't see anything that should cause it to do that.

                  What does your search form tpl look like?
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 40088
                    • 708 Posts
                    The search results tpl:

                    <!DOCTYPE html>
                    
                    <html lang="en">
                    
                        <head>
                    
                        	<meta charset="utf-8" />
                    
                        	<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
                    
                    	<title>[[++site_name]] | [[*pagetitle]]</title>
                    
                    	<link rel="icon" type="image/ico" href="http://.com/favicon.ico" />
                    
                    [[$metaTags]]
                    
                    [[$CSS]]
                    
                    	</head>
                    
                    	<body>
                    
                    		<div id="wrapper">
                    
                    			<header>
                    
                    				<h1 id="logo"><a href="/">[[*longtitle]]</a></h1>
                    
                    			</header>
                    
                    			<nav>
                    
                    [[Wayfinder?
                    	&startId=`0`
                    	&outerTpl=`navOuterTpl`
                    	&rowTpl=`navRowTpl`
                    	&limit=`6`
                    ]]
                    
                    			</nav>
                    
                    				<div id="content">
                    
                    					<aside>
                    
                    						<div id="sidebar">
                    [[!SimpleSearchForm? &landing=`51` &tpl=`mySearchForm`]]
                    							<div id="social">
                    [[$socialNet]]
                    [[$subscribeForm]]
                    							</div>
                    						</div>
                    
                    					</aside>
                    
                    					<section>
                    
                    						<div id="body">
                    [[!SimpleSearch]]
                    
                    							<!-- !Begin Resource Guide -->
                    
                    [[$menuResourceGuide]]
                    
                    							<!-- !End Resource Guide -->
                    
                    						</div>
                    
                    					</section>
                    
                    				</div>
                    
                    			<footer>
                    
                    			</footer>
                    
                    		</div>
                    
                    	</body>
                    
                    </html>
                      Todd
                    • No, I meant the tpl for the search form, the mySearchForm chunk.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org