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
    The release 1.8.0 is now available in the repository.

    This release has the same features than the 1.8.0 beta1
    Changelog:

    -- correct search in Tvs (or any other joined table) - demo here
    -- define where to do the search (&whereSearch parameter) (content,tv,jot,maxigallery,your own non Modx tables) - demo here
    -- search into your own custom tables - demo here
    -- define which fields to use for the extracts (&extract parameter)
    -- Define the number of extracts displayed in the search results
    -- Improvement of the extract algorithm - see demo here - search "primary school" with "exactphrase" option
    -- use AjaxSearch with your own non MOdx tables - demo here
    -- order the results with the &order parameter
    -- define the ranking value and sort the results with it - demo here
    -- filter the unwanted documents of the search
    -- define the extract ellipsis
    -- define the extract separator
    -- define the format of displayed dates - demo here
    -- Avoid search in content of type reference
    -- Extended place holder templating and template parameters
    -- Use of &advSearch parameter available from the front-end by the end user : demo here
    -- Choose your search term from a predefined search word list - demo here
    -- stripInput user function
    -- stripOutput user function - demo here
    -- a message is displayed to the user if his search term is too short - demo here, try "a", then "ab" and "abc"
    -- Configuration file and $__ global parameters
    -- snippet code completely refactored and objectified
    -- Bugfixes regarding Quoted searchstring

    -- the Highlighting plugin takes now into account of &advSearch parameter
    -- An advanced Highlighting plugin is provided - used on all the demos


    And last but not least I have added the last features:

    Changelog:

    -- &clearDefault : clearing default text - demo here

    When the user clicks on the box, the default text is wiped away so that they
    can begin typing. If they click away from the box, without typing anything in,
    we will add the default text back so that they don’t forget what was meant to
    be typed.

    See http://www.yourhtmlsource.com/forms/clearingdefaulttext.html

    0 - clearing default text inactivated (default)
    1 - clearing default text activated



    -- &[b]breadcrumbs to display the path of documents found[/b] - demo here

    0 : disallow the breadcrumbs link
    Name of the breadcrumbs function : allow the breadcrumbs link

    e.g &breadcrumbs=`Breadcrumbs`

    The function name could be followed by some parameter initialization
    A parameter initialization is a couple: parameter name : value

    e.g: &breadcrumbs=`Breadcrumbs,showHomeCrumb:0,showCrumbsAtHome:1`

    The breadcrumbs function could be custom function or a snippet



    -- &tvPhx : Set placeHolders for TV (template variables) - demo here

    0 : disallow the feature (default)
    ’tv:displayTV’ : set up placeholders for each TV (named tvName) linked to the documents found

    Placeholders for TVs are:

    [+as.tvName+], [+as.tvNameShow+], [+as.tvNameClass+]

    Where tvName is the MODx name of a TV

    [+as.tvName+] is the HTML output of your TV
    [+as.tvNameShow+] = 1 if the TV is not NULL
    [+as.tvNameClass+] :
    - ajaxSearch_resultTvName for the non ajax results (&tplResult)
    - AS_ajax_resultTvName for the ajax window (&tplAjaxResult)

    displayTV is a provided ajaxSearch function which render the Modx TV output.

    But &tvPhx could also be a user function and runs with your custom tables.

    Find attached the report of the test done with this release
      • 5811
      • 1,717 Posts
      This version 1.8 is an important update of AjaxSearch and I would like give a particular thanks to

      - Garryn
      - Akots
      - Cbaone
      - Plavet (clear default)
      - Dev_cw
      - Toranaga (searching in Tvs)
      - Enidan
      - Heliotrope (searching in Tvs)
      - Traveller
      - Jgestiot (InputStrip & OutputStrip)
      - Rasc
      - Mark Kaplan (&parents and filter from Ditto)
      - Roscco
      - Rthrash
      - MotSmart
      - ... (I am sure I forget some of you)

      for your discussion, suggestion and encouragement regarding AjaxSearch
        • 18367
        • 834 Posts
        Coroico,

        are you messing with the noobies?

        As this is the fist time I’ve tried Ajax Search of any kind I followed the instructions from the repository page slavishly.

        Then when I executed the snippet in the Resource Manager I got a handful of errors.

        First clue: it’s looking for AjaxSearch and you told us to call it ajaxSearch, you bad boy you.

        Next it was looking for the "templates.includes.php" which isn’t in the zip, but is in the old Ajax Search folder. Easy enough to copy over, but I’m sure you guys do this just to mess with us non-techs.

        Ok, so now on my search page at least it looks like it should work, but when I do a search I get

        "AjaxSearch: database_connection_charset is null. Check your config file"


        Phrases like that frighten the willies out of me.

        So, I managed to negotiate two of your "nooby traps" how do I disarm the last one?

        Thanks laugh



          Content Creator and Copywriter
          • 7231
          • 4,205 Posts
          This is set during the install but sometimes does not work (has been fixed for the next release). Set this manually by editing the manager/includes/config.inc.php file, around line 9 you will see the $database_connection_charset variable, set this to your database charset: $database_connection_charset = ’utf8’; if you are using utf8 charset.

          I think the naming issue must have been a typo..or is this to keep noobies on their toes grin

            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 18367
            • 834 Posts
            OK thanks, that fixed it,

            now to start playing with the rest of it.
              Content Creator and Copywriter
              • 29703
              • 217 Posts
              Hi there, great update.

              I’m really struggling to get the &tvPhx working. The documentation is a little vague at the mo.

              I have my call as follows:

              [!ajaxSearch? &ajaxSearch=`0` &extract=`99` &highlightResults=`0` &AS_showForm=`0` &tvPhx=`tv:displayTV` &tplResult=`@FILE:assets/snippets/ajaxSearch/templates/result.tpl.html`!]


              My TV is called Summaryimage.

              The file assets/snippets/ajaxSearch/templates/result.tpl.html contains the following:

              <div class="[+as.resultClass+]">
                <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
              [+as.descriptionShow:is=`1`:then=`
                <span class="[+as.descriptionClass+]">[+as.description+]</span>
              `+]
              [+as.extractShow:is=`1`:then=`
                <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
              `+]
              [+as.breadcrumbsShow:is=`1`:then=`
                <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
              `+]
              [+as.Summaryimage+]
              </div>


              I’m been trying to figure this out for about 5 hours now to no avail. Any help would be more than appreciated!

              Update - make that 12 hours. . .
                • 7231
                • 4,205 Posts
                Try declaring the TV you want to display in the call:

                &tvPhx=`tv:summaryimage`
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don&#39;t know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                  • 29703
                  • 217 Posts
                  Quote from: dev_cw at Aug 25, 2008, 06:33 AM

                  Try declaring the TV you want to display in the call:

                  &tvPhx=`tv:summaryimage`


                  Thanks for the reply. This didn’t work for me I’m afraid.

                  The demo for this can be viewed at http://www.modx.wangba.fr/index.php?id=177 and it simply uses &tvPhx=`tv:displayTV`

                  Any other ideas?
                    • 7231
                    • 4,205 Posts
                    Looks like you have things right. Is it a typo with the TV name? What about using the Show phx command?

                    I have not installed this new release yet, will see if I get to it later today since I will be needing some of the cool new features.

                    These are the docs:
                    ==== &tvPhx : Set placeHolders for TV (template variables)

                    0 : disallow the feature (default)
                    ’tv:displayTV’ : set up placeholders for each TV (named tvName) linked to the documents found

                    Placeholders for TVs are:

                    [+as.tvName+], [+as.tvNameShow+], [+as.tvNameClass+]

                    Where tvName is the MODx name of a TV

                    [+as.tvName+] is the HTML output of your TV
                    [+as.tvNameShow+] = 1 if the TV is not NULL
                    [+as.tvNameClass+] :
                    - ajaxSearch_resultTvName for the non ajax results (&tplResult)
                    - AS_ajax_resultTvName for the ajax window (&tplAjaxResult)

                    e.g: AS_ajax_resultAsTag1, a tv named "asTag1"
                    (take care, the first letter of tvName should be here an upper case)


                    displayTV is a provided ajaxSearch function which render the Modx TV output. Don’t change the name!

                    But tvPhx could also be a user function and runs with your custom tables.
                    More information and examples coming soon on www.modx.wangba.fr
                      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                      Something is happening here, but you don&#39;t know what it is.
                      Do you, Mr. Jones? - [bob dylan]
                      • 29703
                      • 217 Posts
                      Nope there’s no typo. Basically where the placeholder is in the template, it’s coming up blank. Everything else is functioning perfectly.

                      This is weird - if you get any joy, give me a shout smiley

                      I tried the phx show, but to no avail.