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.

Parse order woes with {embed} and json_encode

April 01, 2012 3:30am

Subscribe [3]
  • #1 / Apr 01, 2012 3:30am

    FCWebTeam

    4 posts

    I know this is probably something crazy to try to do but I’m trying to just json_encode an {embed}.

    I’ve tried using native ee:

    <?php echo json_encode('{embed="objects/_video" entry_id="1234"}') ?>

    And hacking together a plugin to maybe enable the use of parse=“inward”:

    {exp:phpstringfun function="json_encode" parse="inward"}{embed="objects/_video" entry_id="1234"}{/exp:phpstringfun}

    I know this is a parse order issue because embeds are parsed so late in the game. Any ideas though?

     

  • #2 / Apr 01, 2012 7:55am

    ahmad saad

    364 posts

    see this http://gotolow.com/blog/snippets-and-preload-replace-variables

    and try to use snippets and preload-replace Instead of embed

  • #3 / Apr 02, 2012 12:55pm

    Shane Eckert

    7174 posts

    Hey FCWebTeam,

    I am no json expert, so my help here would be limited, but I do agree with Ahmad. Check out the Snippets and Preload Replace Variables document and see if that helps.

    Please let us know how this works out.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases