Variables in embedded Template not parsed.
Posted: 16 June 2009 03:50 PM   [ Ignore ]
Newbie
Rank
Total Posts:  22
Joined  2008-08-20

Can variables in embedded templates be parsed?

I have a custom profile field called “cc_accepted” that called from a regular template like so…

{exp:user:edit}

Your screen name is {screenname}
.

<
p>Some other stuff in my regular template.</p>

{embed="embeds/my_embedded_template"

{
/exp:user:edit} 

Then in ‘my_embedded_template’.

The credit cards you accept are {cc_accepted}

I have tried this… but the variable in the embedded template doesn’t seem to get parsed.

It’s probably in the docs… but I can’t find it.

Thanks in advance for any help offered!

Profile
 
 
Posted: 17 June 2009 09:34 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8264
Joined  2006-10-18
Scruffy - 16 June 2009 03:50 PM

Can variables in embedded templates be parsed?


For sure… you just want to make sure you’re passing any relevant info as well wink

Main Template:

{exp:user:edit}

Your screen name is {screenname}
.

<
p>Some other stuff in my regular template.</p>

{embed="embeds/my_embedded_template" cc_accepted="{cc_accepted}"

{
/exp:user:edit} 


Embedded template:

The credit cards you accept are {embed:cc_accepted}

But you probably want to do this instead:


Main Template:

{exp:user:edit}

Your screen name is {screenname}
.

<
p>Some other stuff in my regular template.</p>

{embed="embeds/my_embedded_template" member_id="{member_id}"

{
/exp:user:edit} 


Embedded template:

{exp:user:stats member_id="{embed:member_id}"}
The credit cards you accept are {cc_accepted}
.
{/exp:user:stats} 
 Signature 
Profile
 
 
Posted: 17 June 2009 01:31 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  22
Joined  2008-08-20

Thank you for the excellent support! Will implement this later today. Thanks!

Profile