ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

backslash, file fields in search results

December 30, 2012 11:52am

Subscribe [2]
  • #1 / Dec 30, 2012 11:52am

    adlur

    104 posts

    Hello, the following search tag

    {exp:search:simple_form no_result_page='search/no-results' result_page='search/results' search_in='entries' channel='not contact_ch|related_products_ch|testimonials_ch'}

    and results page

    {exp:search:search_results}
    <a href="http://{auto_path}" title="{title}">{title}</a>
    {excerpt}
    
    {/exp:search:search_results}

    is returning results 1) from a file field that is set to not searchable (Is field searchable? No.) instead of from any one of the fields that are set to searchable

    http\://www\.[removed]\.com/uploads/general/FPOimage280x160\.jpg

    AND 2) with certain punctuation (apparently?) escaped with backslashes…

    Return Policy\: We provide our customers with a 30\-Day Return Policy\. You have 30 days to return the merchandise to us, for whatever reason\. The 30 days start the day that your merchandise is shipped\. Refund requests must meet the following conditions\: The merchandise must be unused and returned with…

    Any idea why?

  • #2 / Dec 30, 2012 10:15pm

    Chris Arasin

    26 posts

    I am also getting backslashes in my {excerpt} output before colons and periods.

    Edit:
    Looks like there were some ‘bug fixes’ around backslashes and search results in 2.5.4
    http://ellislab.com/expressionengine/user-guide/about/changelog.html#version-2-5-4

    Also, a reported bug here:
    https://support.ellislab.com/bugs/detail/19102

  • #3 / Dec 31, 2012 10:07am

    adlur

    104 posts

    Yup, that’s the stuff. I’ve added

    <?php echo stripslashes('{excerpt}'); ?>

    to the template.

    My other problem was due to the wrong field being selected for the excerpt in the channel preferences…

    Thanks for your help!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases