We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    I put my calls in template.

    Quote from: coroico at Apr 03, 2008, 11:46 AM
    No. The only way to change the form is to customize the default template file.

    Ok then, just wanted to know...

    Not sure to understand your needs. Do you need to change the form of the search (so I undertsand the use of &resultForm= `chunk`) or the subset of documents where to search (&parents parameter) ? Form should be changed through the default template (or in future through a chunk) and subset through &parents in templates or in documents. Where do you put you snippet call? in templates or in documents ?

    Ok let’s clarify this a bit.

    I need to use several form for the search results. It’s probably atypical but for a specific search (with &parents) I don’t need to link to the document (which contains no other data than title, date and category).

    My line of thinking was : since I have the ability to limit search to a given parent or document, I can use custom search forms and I can use the TV’s placeholders in the search result’s form (tested it, it works fine), it can make sense to be able to use several forms for search results.

    Of course I could have several ajaxSearch installs and tweak each of those install templates, but I’d rather maintain a single one, thus my question...
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 5811
      • 1,717 Posts
      Ok I understand your requirement. Unfortunately, this needs to think again the templating possibilities of ajaxSearch and the availibility of chunk parameters to customize the display outputs.
        • 6726
        • 7,075 Posts
        No big deal, I can have separate install and in most case, people won’t need what I do need now... the ability to limit search to a parent is a huge leap forward already grin Not to mention the new search modes... Great job !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 25663 MODX Staff
          • 12,272 Posts
          I think in the future all "core projects" will require the ability to easily template via chunks and config files, so I’d love to see Ajaxsearch support this ASAP. It is just way too handy!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 27708 MODX Staff
            • 2,502 Posts
            This part is actually one of the easiest parts of building a snippet was the ability to use a chunk or snippet for a template. You just use a check to see if there is a user template in a chunk or snippet by name and if not return the the template.

            I don’t know how many placeholders there are but that is the only consideration.
            Cheers,

            Jay
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 13428 ☆ A M B ☆
              • 1,031 Posts
              Don’t know if this issue was posted before but there is something wrong with highlighting on the ’final page’. If I search a word with an utf8 char this word is not highlighted on the found page (if I click on the title in result of AjaxSearch).

              Searched on modx.wangba.fr for ’école’ the word is highlighted in the searchbox but not on the page ’id=77’. In the URL the ’é’ is displayed as ’%26eacute%3B’. Maybe it is not properly reencoded back in utf8.
                • 27733
                • 99 Posts
                Good mornin’ all. I’m working on an implementation of AS (v 1.7.1) on a site and would like to know if it’s possible to separate the search form from the results output. In my case, the design calls for the basic search form in a header div (at the top right of each page), and the results should be output in the content area (inside one of my column divs). As supplied, I see that the results are always output right after the form. This causes a problem when one wants to have the search form available on the results page. Anyone know if it’s possible to achieve this positioning of these AS elements without having to remove the form call in the landing page? Note that, because of the structure of the layout and the fact that it’s fluid (with a max width), I don’t think I can use the absolute positioning method to put the form where I want it. Thanks for any pointers!
                  ------
                  Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
                  • 5811
                  • 1,717 Posts
                  Do yo use the non-ajax mode ?
                  Not sure to fully understand your needs, but try to put
                  [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`87`!]
                  in your template, in the header part. And then, put in the content part of your document (here #87):
                  [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]
                  For more information look at the demo site

                    • 13428 ☆ A M B ☆
                    • 1,031 Posts
                    Quote from: Jako at Apr 05, 2008, 02:07 AM

                    Don’t know if this issue was posted before but there is something wrong with highlighting on the ’final page’. If I search a word with an utf8 char this word is not highlighted on the found page (if I click on the title in result of AjaxSearch).

                    Quick solution for an UTF8 encoded page, change Line 50 of the SearchHighlight-Plugin:
                    $searched = utf8_encode(html_entity_decode(strip_tags(urldecode($_REQUEST['searched']))));


                      • 27733
                      • 99 Posts
                      Sorry, yes - I’m working in non-Ajax mode for this particular site.

                      In my template, applied to all pages including the search results page, I have this call:
                      [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`8`!]

                      In my landing page I have this call in the content area:
                      [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &grabMax=`10`!]

                      Any way of getting around the duplicate results, but keeping the search form in the upper right of the landing page?
                      (Note: screen image attached.)

                      Cheers,
                      Jim
                        ------
                        Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.

                      This discussion is closed to further replies. Keep calm and carry on.