We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32114
    • 4 Posts
    I’m trying to display template variables in the search results. The following code in result.tpl.html is working fine when I’m setting ajaxSearch=’0’

    [+as.extractShow:is=`1`:then=`
    
      <div class="[+as.extractClass+]">[[easy2? &gid=[+as.ObjectImageGallery+] &tpl=`asResult` &thumb_tpl=`asResultThumb` &w=100 & h=100 &limit=1]]
    [+as.extract+] </div>
    
    `+]
    


    but it won’t display the value for [+as.ObjectImageGallery+] when I’m using the same code in ajaxResult.tpl.html and I’m setting ajaxSearch=’1’. Neither will it use the template parameters that are specified in the easy2 call, but it does use the width, height and limit parameters.

    Is this a known issue of am I doing something wrong?
      • 32360
      • 16 Posts
      I have got the same problem as i describe here: http://modxcms.com/forums/index.php/topic,49752.0.html
        [url=http://www.williamastrom.se]Webdesign and CMS developer William
        • 5811
        • 1,717 Posts

        You are right this is an issue. Now registered as AJAXSEARCH-64

        To fix this issue in the file classes/search.class.inc.php , line 1859 replace the line
        if ($value != $this->dcfg[$key]) $ucfg .= sprintf($tpl,$key,$this->cfg[$key]);
        by
        if ((string)$value != (string)$this->dcfg[$key]) $ucfg .= sprintf($tpl,$key,$this->cfg[$key]);