We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    Try to add &AS_showResults=`0` in the snippet call in your header.
    Let me know if it is ok. May be the documentation should be improved
      • 27733
      • 99 Posts
      Thank you, thank you—that did the trick smiley

      One of the things I’d say we’re in the most need of — documentation-wise — are various examples of how to implement the most common placements and functionalities. That said, where would it be most useful to post examples for the community at large? I’d love to contribute in some way as I learn methods that are yet-to-be documented.

      New question: I’ve set up a TV to tag pages with a particular category. Is it possible to restrict a search to pages with a particular tag, using a select field in the AS search form?

      P.S.: I’ve come across a possible enhancement of the templates.inc.php file: To validate in xhtml strict mode, the form fields need to be enclosed within a qualifying tag (of which there a many in the w3c spec). I’ve changed the template to enclose the form fields within a <fieldset> tag.
        ------
        Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
        • 27733
        • 99 Posts
        One more question pops to mind: I’ve been attempting to use an image-based submit button, originally coded as:

        <a href="javascript:document.siteSearch.submit();return false;" title="Submit Search Form">
        <img src="/assets/images/checkmark_ko.png" alt="Go" title="Submit Search Form">
        </a>


        How would I call the form in this case? I’ve attempted explicitly specifying the form’s ID via line 350 of snippet.ajaxSearch.inc.php and adding the above code [sans javascript:] in the templates.inc.php file, but that didn’t work. (Note this is in the context of using snippet in non-Ajax mode.) I’m a bit of a php novice, so I’m guessing I’m just going about this the wrong way.
          ------
          Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
          • 27733
          • 99 Posts
          Sorry, one more question ... a section of the aforementioned project houses an article collection in which the headline is stored in a TV instead of pagetitle or longtitle. The pagetitle is a date mm/dd/yyy, and the longtitle is empty. Can I pull my custom headline into the search results somehow? Or if too complex a scenario in AS, does the concept of dynamically setting [*longtitle*] = [*headline*] sound like a good solution? And if so, how would it be accomplished? FYI, for the typical site pages, I do prefer the longtitle over pagetitle and have adjusted the templates.inc.php file accordingly.
            ------
            Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
            • 5811
            • 1,717 Posts
            Thanks Jim for your feedbacks
            One of the things I’d say we’re in the most need of — documentation-wise — are various examples of how to implement the most common placements and functionalities. That said, where would it be most useful to post examples for the community at large?
            I’d love to contribute in some way as I learn methods that are yet-to-be documented
            Examples can be found in the wiki documentation or on the demo site.
            I am open for any suggestions to improve these examples and interested by your contribution to improve the demo site. Let me know which kind of examples, you would like implemented on the demo site.
            As many Frenchies, my English is pretty poor, so I am also interesting too by any remarks to improve the documentation. The simpliest way to do it, is to become a wiki writer and to contribute.
            New question: I’ve set up a TV to tag pages with a particular category. Is it possible to restrict a search to pages with a particular tag, using a select field in the AS search form?
            Unfortunately, not. This is an interesting idea, I am interesting to know if this improvement could interest others persons. If yes, thanks for your feedbacks.

            The simpliest way to do that is to add a &tag parameter with &tag=`tvname:tvvalue` and then improve the set up of the $listID in includes/snippet.ajaxsearch.inc.php (line 372) and ajaxsearch.php (line 123) before the call to the dosearch function.
            But we need to define if the tag parameter restricts also the &parents or &documents parameter. And if yes, we need first compute the $listID for &parents or &documents and then apply the &tag filter.
            I am currently working on an another snippet, but as soon as I have a moment, I will try to provide you a hack for that.

            I’ve come across a possible enhancement of the templates.inc.php file: To validate in xhtml strict mode, the form fields need to be enclosed within a qualifying tag (of which there a many in the w3c spec). I’ve changed the template to enclose the form fields within a <fieldset> tag.
            OK, I notice this improvement. I will use it when I will improve the templating.

            I’ve been attempting to use an image-based submit button ... How would I call the form in this case?
            To understand how you could customize you AS widget, look at this interesting post from therebechips

            Can I pull my custom headline into the search results somehow? Or if too complex a scenario in AS, does the concept of dynamically setting [*longtitle*] = [*headline*] sound like a good solution? And if so, how would it be accomplished?
            A dynamically setting [*longtitle*] = [*tv content*] doesn’t exist. The solution will come will a better templating and the possibility to define/arrange the output by using pagetitle, longtitle but also tv_content

              • 6726
              • 7,075 Posts
              Quote from: coroico at Apr 08, 2008, 07:06 AM
              New question: I’ve set up a TV to tag pages with a particular category. Is it possible to restrict a search to pages with a particular tag, using a select field in the AS search form?
              Unfortunately, not. This is an interesting idea, I am interesting to know if this improvement could interest others persons. If yes, thanks for your feedbacks.

              +1 I am interrested by this too, as will many people I guess.

              Currently the only way to do an advanced search with select is tvExplorer, as far as I know... Maybe talk with Heliotrope about this smiley
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 27733
                • 99 Posts
                Merci beaucoup, coroico. My French doesn’t go too much further than that but, for the record, your English is really quite good. I look forward to future enhancements and will become a wiki member as suggested. Cheers!
                  ------
                  Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
                  • 5811
                  • 1,717 Posts
                  Thanks Jako for this quick solution about this issue. I have already noticed it, but by lack of time, not investigate on it. This issue don’t occur with the non ajax-mode and as it didn’t exist with the previous version, is clearly a code regression >:(
                    • 27733
                    • 99 Posts
                    Hello again, coroico. I’m curious if PHx tags are compatible with AS. If they are, I may be able to solve my problem with setting the value of one TV to another from a different angle: by using a conditional tag in PHx. If I’m understanding it correctly, where [+as.longtitle+] — in my case I chose this over the default [+as.pagetitle+] — appears in the AS template I could use:
                    [+phx:if=`[+as.longtitle+]`:is=``:then=`[+as.articleTitle+]`:else=`[+as.longtitle+]`+]


                    The other factor I know may be an issue is whether or not AS is grabbing the TVs I’ve created — [+as.articleTitle+]1 above for instance — and whether hacks to the other AS includes would be necessary to make that TV usable.

                    1 the actual TV being [*articleTitle*]
                      ------
                      Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
                      • 27733
                      • 99 Posts
                      ... or I could possibly use [+as.longtitle:ifempty=`[+as.articleTitle+]`+] ... assuming PHx compatibility.
                        ------
                        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.