We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25109
    • 6 Posts
    Hi

    i’m kinda stuck. I was trying to use SimpleSearch with my site and have a problem with getting the right result-links.
    Situation: (in resource tab it looks like this)

    News-Section (parent)
    -> news entry 1 (child 1)
    -> ...
    -> news entry n (child n)

    News-Section got a template with a getresources call so that it can show all the news entries and a moderator can easily edit them in the backend. Problem is that if SimpleSearch find a searchterm in the news entries it gives me the link to that exact news entry in its result list. But i need it to link to the parent, because the parent renders all the news entries and i dont want to go to one specific entry. Could find any answer to this problem in the forums so far... please enlighten me.


      • 25109
      • 6 Posts
      My News Template has
      [[!getResources? &parents=`[[*id]]` &tpl=`tpl_div_news-block` &sortdir=`ASC` &includeContent=`1`]]
      in it, thus listing all the news-entries. News-Section and the News-entries use this template.

      tpl_div_news-block chunk:
      <div class="news-block">
      <div class="news-block-title"><h2>[[+pagetitle]]</h2></div>
      <div class="news-block-left"></div>
      <div class="news-block-right">[[+content]]</div>
      </div>

      resource tab:
      News Section (id 17)
      |
      |-> news entry 1 (id 22)
      |-> news entry 2 (id 28)
      |-> news entry 3 (id 29)

      Simple Search finds the search term in News entry 2 and gives me a link to resource with id 28.
      This shows the news text without the the Pagetitle. I would like Simple search to link to the parent with id 17 if it finds a match for any of the news entries.

      Is that even possible?