We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9869
    • 41 Posts
      --
      Design Agency - http://fruehjahr.ch
      • 13094
      • 58 Posts
      I don’t need the extracted words and so on -- that is all fine.
      I need to know where [+as.pagetitle+] is stiched together for the template-files.

      I just opened the cowling of the search thingy... I found several places but not the pagetitle integration into the anchor.
      In the templates you’ll find something like this:
      <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
      


      resultlink is generated by the modx api makeUrl() but I can’t figure out where pagetitle comes from, yet.
        • 5811
        • 1,717 Posts
        Hi iRolf

        as.resultlink is generated inside class/search.class.inc.php file - see the setResultLink function (about line 1402)

        as.pagetitle but also all the displayed fields of a document (like as.longtitle, as.intro, ... ) are generated in the setResultSearchable function (about line 1553). To catch and change the as.pagetitle change the following lines:
            // set Phx for displayed fields of the main table
            foreach($this->main['displayed'] as $field) $this->setPhxField($field,$row,'string');
        
        To understand what are the displayed fields, refer to the initSearchContext function. Default displayed fields are listed line 529
          • 13094
          • 58 Posts
          Thank you coroico,

          those hints where enlightend shocked

          I understood the array in 529 but I didn’t brought that together, concerning the output.

          In my "environment" everthing is fine, when I modify line 847 like the following code -- but I really don’t know why this is necessary (and what I’m doing at all), ’cause you are checking database charset and converting utf-8 in the extract part.

          This is what helped me:
            function cleanText($text,$stripOutput) {
          
              if (function_exists($stripOutput)) $text = $stripOutput($text);
              else $text = $this->defaultStripOutput($text);
              return utf8_decode($text); // do the utf-8 twist
            }