We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New content in ajax requests

Developer Preview

David Dexter's avatar
David Dexter
88 posts
11 years ago
David Dexter's avatar David Dexter

In BrilliantRetail we get the shipping rates and payment methods via an ajax call to an ACT url.

Funny new hidden stuff

Any thoughts where the new ra:asdfdasf stuff came from? Do I need to run that through the parser to remove it before returning it?

Best, David

       
Derek Jones's avatar
Derek Jones
7,561 posts
11 years ago
Derek Jones's avatar Derek Jones

Is the Template parser involved at all on this ACT request, David?

       
David Dexter's avatar
David Dexter
88 posts
11 years ago
David Dexter's avatar David Dexter

yes, for example we store the shipping option ‘layout’ in a snippet to give developers control over the returned value. We parse the variables to insert the available rate data and then run it through the parser to handle conditionals / etc.

$tmp = $this->EE->TMPL->parse_variables($snippetdata, $vars);
$this->EE->TMPL->parse($tmp);
$output .= $tmp;
       
Derek Jones's avatar
Derek Jones
7,561 posts
11 years ago
Derek Jones's avatar Derek Jones

If you’re intending that these “layouts” are fully parsed by the template engine, you’ll need to add a step:

$tmp = ee()->TMPL->parse_globals($tmp);

That will parse global variables as well as remove any stray EE comments (the ones you are seeing are for runtime template annotation).

       
David Dexter's avatar
David Dexter
88 posts
11 years ago
David Dexter's avatar David Dexter

Thanks Mr. Chief Maker,

That did the trick. We’ll run some additional test but as of now I think we are fully EE 2.9 compatible.

Best, David

       
Derek Jones's avatar
Derek Jones
7,561 posts
11 years ago
Derek Jones's avatar Derek Jones

Awesome, glad to hear it.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.