We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39131
    • 84 Posts
    Good afternoon,

    on this site https://www.nmldesign.nl/ I'm using SimpleSearch.

    When I search for the name of the owner "Nathali", also links to images are shown.

    ...voor kleuradvies en leerzame workshops ben je bij mij aan het juiste adres img src="assets/images/nathali-meurspas-nmldesign-default.jpg" alt="woonkamer" height="564" width="968" Interieurontwerp particulieren...


    Is there any way to prevent showing imagelinks in the search results? So just plain text in the searchresults.
      • 36818
      • 119 Posts
      you could use a the output modifier "striptags, stripTags,notags,strip_tags" (see https://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)) or you build a snippet with the necessary functionality (e.g. here https://forums.modx.com/thread/82317/custom-modifier-strip-tag-by-class-or-id.
        • 39131
        • 84 Posts
        Thanks. I have no experience with this kind of tags.

        The normal SimpleSearch syntax is:

        [[!SimpleSearchForm]]
         
        <h2>Results</h2>
        [[!SimpleSearch]]


        Do you have any idea where I have to put that output modifier you are mentioning?

        Thanks in advance!
          • 36818
          • 119 Posts
          SimpleSearch can be templated via Chunks:
          [[SimpleSearch? &tpl=`Chunk` &showExtract=`1`]]
          and the Chunk e.g. contains
          <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>


          Asuming that your image-tags show up in the extract (i.e. a portion of the content-field of a resource) you could write:

          ... [[+extract:notags]]...
          or
          ...[[+extract:YourOwnSnippet]]...


          "YourOwnSnippet" then takes "extract" as input where you can treat this input however you like.

          hth
          f.


          Quote from: mewolari at Oct 02, 2015, 04:57 PM
          Thanks. I have no experience with this kind of tags.

          The normal SimpleSearch syntax is:

          [[!SimpleSearchForm]]
           
          <h2>Results</h2>
          [[!SimpleSearch]]


          Do you have any idea where I have to put that output modifier you are mentioning?

          Thanks in advance!