First thing would be to make sure your result page isn't cached and make sure you have cleared the cache before doing a search, also make sure the pages are published. that said I don't have a lot of experience with Articles so I may be way off.
Under what container, if any, did you create the search-results.html ?
Check the address bar of the 404 page that the form is producing...
is it www.yoursite.com/blog/search-results.html
or www.yoursite.com/search-results.html ?
<form id="quick-search" action="/blog/search-results.html" method="get">
Just make sure that the form is looking for the resource in the right place.
If all is matching up correctly, when you search for something you should see a blank search-results.html not a 404 message.
Note, that search form is pretty dead, unless I am grievously mistaken, it is, as you will notice, a mere sample!
You'll need an Addon, simplesearch or ajaxsearch. Something viable!
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
☆ A M B ☆
- 24,524 Posts
You can restrict the scope of the search using the &ids and &idType properties.
ids - A comma-separated list of IDs to restrict the search to.
idType - The type of restriction for the ids parameter. If 'parents', will add all the children of the IDs in the ids parameter to the search. If 'documents', will only use the specified IDs in the search.
Replacing the sample search block with a search snippet is the correct way to do it; then you can adjust the search form tpl to match the look of the sample if you like.
http://rtfm.modx.com/display/ADDON/SimpleSearch.SimpleSearch
I don't want to search my entire site.
I throw my blog entries under containers (i.e another document) if they are not already under containers. If you are using Articles Addon, your blog content is grouped under containers already
==> /blog2/my-first-entry.html (
blog2 is a container, a parent!)
[[!SimpleSearchForm]]
[[!SimpleSearch? &depth=`50` &ids=`209,259` &idType=`parents` &hideMenu=`1` &processTVs=`0` &highlightTag=`strong` &tpl=`tpl`]]
//209,259 are the resource ids of my blog containers/parents. The search will involve only the children pages
If you run into problems using the &ids and &idType, report it to
https://github.com/splittingred/SimpleSearch/issues?page=1&state=closed apparently it has some issues.
If you like so much the presentation of the sample.template search form, you could edit the html of the simplesearch form...look for the simplesearch category folder under
chunks, then
simpleSearchTpl. Make sure you back it up before you blow it apart
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
Yea, Susan already posted while I was typing...follow what she says...
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
☆ A M B ☆
- 24,524 Posts
Don't edit any of the default Articles templates and chunks. Copy them with different names and specify your copies in the main Articles configuration. If you edit the existing elements, they will be overwritten if you upgrade Articles at some point in the future.
Place this form code wherever you want in the template or resource
[[!SimpleSearchForm? &tpl=`simpleSearchTpl` &landing=`36`]]
//landing-page is a SimpleSearchForm property
//36 is the id of search-results.html
Then place this in the search-results.html resource
[[!SimpleSearch? &ids=`17` &idType=`parents` &depth=`50` &showExtract=`0` &tpl=`ArticlesSearch`]]
//why &showExtract=`0` ? unless you don't want
//resources under Articles Container are hidden by default. try &hideMenu=`2`
//the ArticlesSearch chunk here should look something like :
<div class="sisea-result">
<h1>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h1>
<div class="extract"><p>[[+extract]]</p></div>
</div>
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.