We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19119
    • 22 Posts
    Hello,

    I have a weird problem. I’m using my own template to display the results. They are based on files we can found on ajaxSearch directory.

    Here is the call to the snippet ajaxSearch :
    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`116` &tplLayout=`optionSearch` &tplResults=`searchResults` &tplResult=`searchResult` &tplPaging=`searchPaging` &tvPhx=`tv:displayTV`!]


    Here is the call on the landing page :
    [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0` &grabMax=`30` &order=`publishedon DESC` &formatDate=`d/m/y` &tplResults=`searchResults` &tplResult=`searchResult` &tplPaging=`searchPaging` &tvPhx=`tv:displayTV`!]


    The chunk optionSearch :
    <form [+as.formId+] action="[+as.formAction+]" method="post">
    <input id="ajaxSearch_input" class="cleardefault" type="text" name="search" value="[+as.inputValue+]" [+as.inputOptions+] />
    <input id="ajaxSearch_submit" type="submit" name="sub" value=" " />
    <input type="radio" id="radio_oneword" name="advSearch" value="[+as.oneword+]" [+as.onewordChecked+] /><label for="radio_oneword">[+as.onewordText+]</label>
    <input type="radio" id="radio_allwords" name="advSearch" value="[+as.allwords+]" [+as.allwordsChecked+] /><label for="radio_allwords">[+as.allwordsText+]</label>
    <input type="radio" id="radio_exactphrase" name="advSearch" value="[+as.exactphrase+]" [+as.exactphraseChecked+] /><label for="radio_exactphrase">[+as.exactphraseText+]</label>
    </form>


    The chunk searchPaging :
    [+as.tpl:is=`paging`:then=`
    <tr><td> </td></tr>
      <tr><td class="ajaxSearch_paging" colspan="4" align="center">
        [+as.pagingText+]
        [+as.pagingLinks+]
      </td></tr>
    `+]
    [+as.tpl:is=`pagingLinks`:then=`
      <a href="[+as.pagingLink+]" class="ditto_previous_link">[+as.pagingText+]</a>[+as.pagingSeparator+]
    `+]
    [+as.tpl:is=`pagingLinksCurrent`:then=`
     <span class="ditto_currentpage"> [+as.pagingText+]</span>[+as.pagingSeparator+]
    `+]


    The chunk searchResult :
    <tr>
    <td class="[+as.resultLinkClass+]"><a href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.publishedon+]</a></td>
    <td class="[+as.resultLinkClass+]"><a href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a></td>
    <td class="[+as.resultLinkClass+]"><a href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.liste_svn+]</a></td>
    <td class="[+as.resultLinkClass+]"><a href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.description+]</a></td>
    </tr>


    The chunk searchResults :
    [+as.noResults:is=`1`:then=`
    	<div class="[+as.noResultClass+]">
    		[+as.noResultText+]
    	</div>
    `:else=`
    <div align="center">[+as.resultInfoText+]</div>
    <table border="0" width="100%" align="center" cellpadding="1">
    <tbody>
    <tr>
    <td width="100" class="ajaxSearch_head">Publiée le</td>
    <td width="100" class="ajaxSearch_head">Document</td>
    <td class="ajaxSearch_head">SVN</td>
    <td class="ajaxSearch_head">Libellé</td>
    </tr>
      [+as.listResults+]
      [+as.paging+]
    </tbody>
    </table>
    `+]


    Hope you’ll be able to help me smiley
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      Maybe I missed it, but what exactly is the problem you’re having?
        • 5811
        • 1,717 Posts
        Mephisto, like Everett I don’t understand what is exactly your problem ? I understand that something don’t work correctly but what ?
          • 19119
          • 22 Posts
          Oups, I made screenshots and forgot to post them grin

          Here are two screenshots of my problem (The first is the beginning of the result page, the second is at the end)


          Edit : It seems that I only this problem when there is more than 1 page
            • 19119
            • 22 Posts
            Hi again,

            I forgot this problem, and it’s still not solved sad so if anyone has an idea let me know smiley
              • 9207 ☆ A M B ☆
              • 2,475 Posts
              Sorry, I’m still not exactly sure what the problem is. Could you state it again? Thanks.
                • 26931
                • 2,314 Posts
                i think he means
                [+as.tpl:is=`paging`:then=`
                at the beginning, and
                +]
                `+]
                at the end not being parsed and showing up on the page
                  • 20413
                  • 2,877 Posts
                  1. TRY only one instead of two:
                  &tplResults=`searchResults` &tplResult=`searchResult`

                  2. Go back to using the default Tpl’s insted of your modified Tpl’s to see which one is breaking the code.

                  3. Are you making use of this ---> http://modxcms.com/forums/index.php/topic,34634.msg210436.html#msg210436 ?
                    @hawproductions | http://mrhaw.com/

                    Infograph: MODX Advanced Install in 7 steps:
                    http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                    Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                    http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                    • 19119
                    • 22 Posts
                    @sharkbait :
                    Yes that’s my problem

                    @mrhaw :
                    One tpl is for Results and the other one is to show how many result the search found.

                    I’ll try to use one tpl at a time to see which one doesn’t work.

                    Thanks for the answers smiley
                      • 5811
                      • 1,717 Posts
                      @mephisto

                      I think that your issue is due to the number of parsed PHx. I already noticed that a great number could break the parsing process.

                      I don’t know why but I think that the chunkie class used by Phx doesn’t manage correctly a big number of PHx tags.
                      See for instance this discussion that I had with Doze regarding AnythingRating : http://modxcms.com/forums/index.php/topic,30249.msg183775.html#msg183775

                      See on the same subject this post: http://modxcms.com/forums/index.php/topic,35839.msg216603.html#msg216603

                      As example do a search with the searchterm "the" on the demo page http://www.modx.wangba.fr/index.php?id=257 or try with French documents (on the bottom left side you could choose the language of documents) do a search with "les".

                      I think that the Modx community will be very pleased if somebody have a fix for this issue which could happen potentially with each snippet which use the chunkie class provided with the PHx plugin (maxigallery, ajaxSearch, ...)