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.

Assign Variable from embed result. Possible?

January 20, 2010 5:10pm

Subscribe [2]
  • #1 / Jan 20, 2010 5:10pm

    anthonys

    54 posts

    I would like to do something like so:

    {assign_variable:the_entry_id=" {embed="site/number_finder" segment="{segment_3}” }  ” }

    But on page its showing:
    Parse error: syntax error, unexpected ‘{’ in /core/core.functions.php(634) : eval()‘d code on line 16

  • #2 / Jan 20, 2010 5:42pm

    Peter Ripley

    93 posts

    Have you tried assigning the variable in the embedded template, instead of in the embedding template?

  • #3 / Jan 20, 2010 5:48pm

    anthonys

    54 posts

    Yea, if I do it that way I can’t use the assigned variable in the parent template. An assigned variable will only work it the template you assign it in it seems. I need to use it in the parent, not the embed.

  • #4 / Jan 20, 2010 5:57pm

    Focus Lab Dev Team

    1129 posts

    It might have to do with the level of quotations, this is untested but try this

    {assign_variable:the_entry_id=”{embed='site/number_finder' segment='{segment_3}'}"}
  • #5 / Jan 20, 2010 6:12pm

    anthonys

    54 posts

    Thanks Eric, that got it working. 😊

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

ExpressionEngine News!

#eecms, #events, #releases