On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi Folks,

    I started to use YAMS for my MODx projects and like it very much! I managed all the "big issues" (Ditto, eForm) thanks to the documentation. However, what is missing is a description on how to setup AjaxSerach to operate correctly with YAMS.

    I would use this thread to create a document for the RTFM section. Since I'm pretty new to YAMS I need some help. In addition I can do the translation into German if this is of interest.

    Here is what I've accomplished so far:

    According to the short description in "assets/modules/yams/snippets/ajaxsearch/yams.ajaxsearch.config.inc.php" I've changed the placeholders from

    [[YAMS? &get=`data` &from=`pagetitle` &docid=`[+as.id+]`]]

    and added

    require_once( $modx->config['base_path'] . 'assets/modules/yams/snippets/ajaxsearch/yams.ajaxsearch.config.inc.php' );

    to the ajaxsearch config file.

    My snippet call looks like this:
    [!AjaxSearch? &ajaxSearch=`0` &landingPage=`39` &showResults=`0` &stripOutput=`asParseYAMS`!] 

    The snippet call on the landing page:
    [!AjaxSearch? &stripOutput=`asParseYAMS` &ajaxSearch=`0` &showInputForm=`1` &showResults=`1` &tplResult=`AS_Result_tpl`!]

    <div class="[+as.resultClass+]">
      <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[[YAMS? &get=`data` &from=`pagetitle` &docid=`[+as.id+]`]]</a>
      <span class="[+as.descriptionClass+]">[[YAMS? &get=`data` &from=`introtext` &docid=`[+as.id+]`]]</span>
      <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
      <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>

    Now the problem is when I'm searching for a language specific term e.g. "produkte" (german word for products" on the english page I get the results from the german text. I assume that has something to do with [+as.extract+] in the AS_Result_tpl.

    Any ideas how to get this working? Or is there a howto that can help me to solve this on my own?