We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17412
    • 270 Posts
    I’m using default Modx document fields to populate information for a job database that can be searched by AjaxSearch.
    I’m using link_attributes for example to input "Location" however I’ve noted that of all the default fields I’ve used (Job title = pagetitle, Job reference = longtitle, etc) link_attributes won’t display at all - you can’t search on it and the placeholder doesn’t output anything.

    This is by ajaxResult TPL:

    <tr class="[+as.resultClass+]">
    <td><a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a></td>
    <td class="last-column"><a href="[+as.resultLink+]&ref=[+longtitle+]">Now</a></td>

    Is link_attributes ignored by AjaxSearch?

    For reference here’s my call:

    [!AjaxSearch? &asId=`recruit` &ajaxSearch=`0` &showInputForm=`1` &tvPhx=`tv:displayTV` &tplResult=`ajaxResult` &tplResults=`ajaxResults` &tplInput=`tpl_search` &parents=`225`!]

    Environment: Modx EVO: 1.0.5-rc1 / PHP Version 5.2.14 / CentOS

    Thanks in advance.
      • 5811
      • 1,717 Posts

      Is link_attributes ignored by AjaxSearch?
      If you need this field replace the lines #96 & #97 of class/ajaxSearchRequest.class.php by:
                          'searchable' => array('pagetitle', 'longtitle', 'description', 'alias', 'introtext', 'menutitle', 'content','link_attributes'),
                          'displayed' => array('pagetitle', 'longtitle', 'description', 'alias', 'introtext', 'template', 'menutitle', 'content','link_attributes'),

        • 17412
        • 270 Posts
        Fantastic - thanks for your help!