We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24495
    • 407 Posts
    Sorry, my first attempt was looking at the demo site embarrassed And there I missed some information about this extensive template-capability (or I’ve doesn’t seen it; was late evening yesterday after the german victory in EM2008) grin
    That’s a version I will test next days. Thanks for your good work!
      • 5811
      • 1,717 Posts
      I understand, no problems. With The French Team, I have more time grin
        • 24495
        • 407 Posts
        Is it a feature or a bug? It only works with a user-defined template with this AS call (cut):
        ... &tplLayout=`@FILE:assets/snippets/ajaxSearch/templates/layout.tpl.html` ...


        Tried all other versions:

        • layout.tpl.html
        • templates/layout.tpl.html
        • /templates/layout.tpl.html
        • sinmpleSearch
        Nothing works. What’s wrong?

        Apart from that: Pretty good work! Very flexible.
          • 5811
          • 1,717 Posts
          &tpl parameters should works as :

          1/ chunck: For that copy/paste the template in a chunck and give the chunck name.

          e.g &tplLayout=`mytplLayout`

          2/ file: with "@FILE:" as prefix card before the path (relatively to your modx root) to the file.

          e.g: &tplLayout=`@FILE:assets/snippets/ajaxSearch/templates/myLayout.tpl.html`

          If it doesn’t work, you have find a bug sad otherwise I will improve the documentation later.
            • 24495
            • 407 Posts
            Tried with chunk: it works PERFECT!

            I think this templating is the best improvement of AS (for me).
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              I have upped all the files and tried this call [!AjaxSearch? &showMoreResults=`1` &moreResultsPage=`72`!]

              The ajax isn’t working and it’s not searching either. When I click search, it just reloads the home page again. I took out all other JS files to make sure there was no compatibility problems but this didn’t help.

              Thanks Ross

              Just used firebug and it’s reporting 2 errors?

              syntax error
              [Break on this error] idgrp = ;\n
              home.html (line 85)

              Window.onDomReady is not a function
              [Break on this error] Window.onDomReady(activateSearch);

              1.71 worked fine for me... thanks
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 24495
                • 407 Posts
                The extract of search result is included in dots (...). Typographically correct it should be
                …

                Probably these characters should be included in the language files for individual settings? Maybe some people would have the dots, some like dashes or quotes.

                And another question: Is it possible to filter search results (e.g. excluding documents) by template documents using? I have some folders including documents, but the folders itself are empty or have a FirstChildRedirect and maybe used as a navigation item. Therefore they have a pagetitle or more information and will be found by AS. I wish to exclude documents using a determined template. Would be a nice feature.
                  • 5811
                  • 1,717 Posts
                  @Rosco
                  I got the same issue with the same ajaxSearch Call. I have changed the way of writing the javascript variables. Infortunately with false, you get idgrp= in your javascript header. To solve that, in the snippet line 175 and line 178 change the "true" by ’’ (2 simples quotes).

                  // IDs of documents to retrieve their children to &depth depth  where to do the search
                  $cfg['parents'] = isset($parents) ? $parents : (isset($__parents) ? $__parents : '');
                   
                  // IDs of documents where to do the search
                  $cfg['documents'] = isset($documents) ? $documents : (isset($__documents) ? $__documents : '');


                  I will check the others parameters initialized with boolean.
                    • 5811
                    • 1,717 Posts
                    @Rasc

                    Probably these characters should be included in the language files for individual settings? Maybe some people would have the dots, some like dashes or quotes.
                    Good idea. I will add this parameter (ellips) in the next 1.8.0 beta1.

                    And another question: Is it possible to filter search results (e.g. excluding documents) by template documents using? I have some folders including documents, but the folders itself are empty or have a FirstChildRedirect and maybe used as a navigation item. Therefore they have a pagetitle or more information and will be found by AS. I wish to exclude documents using a determined template. Would be a nice feature.
                    Regarding the exclusion of documents, i hesitate between to implement the Ditto filters or to propose a light filter for instance :
                    &filter=`tvname:value || list of ids` a document will be exclude if a tv exist and = value, OR if belongs to a list of ids.

                    I am not sure to undertsand what you mean by exclude documents using a determined template What is your idea ?
                      • 24495
                      • 407 Posts
                      What is your idea ?
                      I often use a navigation with a main navigation item (e.g. Contact) and subpages (Contact form, How to reach us, Legal information). The main item/document is empty, containing only the firstChildRedirect snippet but acting as a menu item. Clicking this contact menu item user will be redirected to the contact form document (the first child).

                      For better maintenance and a better understanding of the system used by my clients I set up templates for each type of document. E.g. there is a template for common pages, a template for the (specific built) start page, templates for press releases or events or job offers and so on. Each template contains its necessary TVs. And mostly I have a special template for the "redirect to first child" because my clients shall not put snippet calls into a page. These empty documents contain pagetitle and sometimes a longtitle and/or description for special needs. AS find these documents (it’s too much work for my clients to set documents unsearchable grin). And so I have e.g. "Contact" twice in the search results (one for the contact form document itself and one for the parent doc redirecting to contact form).

                      Therefore it would be nice to have a filter excluding documents using the e.g. "redirecting template" (identified by the template id seen in DocManager module). Or is there a way with PHx?