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.

Keywords Obfusicated.

October 29, 2012 5:10pm

Subscribe [2]
  • #1 / Oct 29, 2012 5:10pm

    Hi Folks,

    I’m wondering why

    {exp:search:keywords}

    Works just fine by itself, however as a preload_replace or within the search_results loop it yields the obviously obfusicated:

    M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr


    I need the search term as an early-available string to help me filter results - whether I pull it as preload-replace or within the results loop is of no consequence to the template:

    {preload_replace:keys="{exp:search:keywords}"}
    
    <h1>Search for: {exp:search:keywords} returned {total_results} result{if total_results > 1}s{/if}.</h1>

    Search for: M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr returned 1 result.

    Is there a way to get what I want out of these features? Any addons that could be suggested too? Many thanks in advance.

  • #2 / Oct 29, 2012 5:41pm

    airways

    154 posts

    Lots of times I see this kind of thing happen when processing of a plugin is actually crashing. Look in your PHP error logs to see if there are any errors there, and make sure DEBUG is set to 2 or 1 (and you are logged in as an admin).

  • #3 / Oct 30, 2012 6:01pm

    Kevin Smith

    4784 posts

    Hey Caroline,

    That string is a marker the template parser uses as a placeholder for data as it’s running through the template engine. It’s coming up here because the search results aren’t yet available by the time preload_replace variables are set and parsed, and {exp:search:keywords} isn’t available inside the search results loop.

    Why were you wanting to use the results as a preload_replace variable? And does it work outside the search results loop?

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

ExpressionEngine News!

#eecms, #events, #releases