We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello, I can't make that SimpleSearch display a custom TV text in the results... Is only displaying [[*content]]

    Has some one done that before? Help Please!!

    My Display Search results code:

    [[!SimpleSearch? 
    &tpl=`searchResultPages` 
    &includeTVs=`1` 
    &processTVs=`1` 
    &showExtract=`1` 
    ]]


    &tpl=`searchResultPages` Code:

    <div class="sisea-result">
        <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
        <div class="extract"><p>[[+extract]]</p></div>
    </div>


    I'm not sure about what to put on this fields: &includeTVs=`1` &processTVs=`1`

    The TV that I need to display in the results is:
    doit_tab_description (21)

    I try put the name, ID, different options... nothing!!! sad

    &processTVs=`doit_tab_description`
    &processTVs=`21`

    I dont know what to do!!

    Ideas???
    Thank you!!!!
      --
      ysanmiguel.com
      • 18608
      • 112 Posts
      See the rtfm for processTV. http://rtfm.modx.com/extras/revo/simplesearch/simplesearch.simplesearch

      You nede to put this In your tpl where you want it:
      [[+doit_tab_description]]


        Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
        • 33238
        • 388 Posts
        Mathias Dannevang, Thanks for Your answer my friend...

        That works, adding [[+doit_tab_description]] in my tpl, it display the text, that is good, Thank you!!!

        But, is not limiting the text to: &showExtract=`1` &extractLength=`200`
        is showing the whole content in the TV, and some tv's have a lot of content...

        And the: &highlightResults=`1` is not working too.
        The results inside the [[*content]] are right, only display 200 characters and the word is in highlight but not the TV content...

        What is wrong??

        I try:

        &includeTVs=`1`
        &processTVs=`doit_tab_description`

        or

        &includeTVs=`1`
        &processTVs=`21` (tv ID)

        And still displaying the whole TV content... o_O

        Thank you!!!
          --
          ysanmiguel.com
          • 18608
          • 112 Posts
          Try this in your call:
          [[!SimpleSearch? 
          &tpl=`searchResultPages` 
          &includeTVs=`1` 
          ]]
          


          If the TV's only contain text there are no need to process them first. It will be faster not to.

          The showExtract parameter refers to the content field, not the TV. If you want the same function you should use an output modifier on the tv call in the tpl, like this:

          <div class="sisea-result">
              <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
              <div class="extract"><p>[[+doit_tab_description:limit=`200`]]</p></div>
          </div>
          
            Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
            • 33238
            • 388 Posts
            Mathias thank you again for your help...

            The [[+doit_tab_description:limit=`200`]] create the effect but has many problems...

            - For example it display the first 200 characters but if exist some <span> <div> it will bring it too, but if the </> close symbol is not between those 200 characters, so there is the problem... because there going be an open <div> that going to destroy the html structure.

            - Other problem is that only display the first 200 characters, that is all, even of the word that you are looking for is not in the first 200, or 300 or the number that you decide to display.

            and the hightlight does not work!!

            It create the effect but I think that is not the proper way to display a TV content, anyway to solve this problems I use this code, base in your idea, so Thank you very much!!!

            <div class="extract">[[+extract]][[+doit_tab_description:limit=`250`:strip_tags=``]]...</div>

            :strip_tags=`` will delete any html etiquettes.

            and the ... (dots) at the end is because I want show the dots ant the end in the estract and the TV, so I set the option &extractEllipsis=`` and I add the dots. A simple solution.

            But still having problems...

            What do you think?
              --
              ysanmiguel.com