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.

Fresh Variables question

January 30, 2008 1:53am

Subscribe [2]
  • #1 / Jan 30, 2008 1:53am

    DEA

    257 posts

    First off - love this, very helpful. Here’s my issue:

    I’m using Fresh Variables to store some cookie values. A sample variable:

    <?
    if (isset($_COOKIE["exp_thevar"])) 
     echo $_COOKIE["exp_thevar"];
    ?>

    So far so good, it works nicely. Now, however, I drop it into a weblog custom field search like this:

    search:mycustomfield="{myfreshvar}"

    This produces no results though. To test, I hardcoded the cookie value in there and it worked fine. Is this some kind of parse order issue (please gawd no…)

  • #2 / Jan 30, 2008 2:02am

    DEA

    257 posts

    Bummer, answered my own question. I needed to have PHP on input on the page for it to render the code earlier. Makes sense, but I’ll need to ditch it in favour of embeds instead then, as this will have to be usable across many other pages with a variety of input/output PHP settings.

  • #3 / Feb 01, 2008 1:02am

    DEA

    257 posts

    I’m still wrong. Have now set this in an embed, even with PHP on input, and still the search: parameter returns nothing. I’ve tried assignvariable with the embed, putting the embed in the param directly…nothing. Have I hit a limitation of the search: field.

    UPDATE: Apparently I drank the bong water tonight. It is indeed working. What is wrong with me? :red:

  • #4 / Feb 01, 2008 5:42am

    Mark Bowen

    12637 posts

    Hi DEA,

    So it is all working for you now?

    Would you possibly show your full working code as I might have a need to do this in the near future and it would be great to see what you did.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases