1

Is it possible parse ExpressionEngine tags inside the content of another tag?

{exp:channel:entries channel="my_channel"}  
    {parseit {my_field}}
{/exp:channel:entries}

my_field should contain any expression engine tag, even embed if it's possible. Maybe it's possibile using stash, but I can't got how.

Thanks

EDIT, SECOND QUESTION, added allow_eecode:

<?php
    require_once "php.include/user_agent.inc.php";
?>
{embed="include/.head"}

{if segment_1 == ""}
    {exp:channel:entries channel="index" limit="1"} 
        {exp:replace_plus find="index.php|.php|/app" replace="{path='site_index'}||{path='site_index'}app/" multiple="yes"}
            {responsive_body_{language_code}}
        {/exp:replace_plus}
    {/exp:channel:entries}
{/if}

{exp:channel:entries channel="multi_version|responsive" limit="1" require_entry="yes"}
    {if segment_1 != ""}
        {if no_results}
            {redirect="404"}
        {/if}
    {/if}
    {exp:replace_plus find="index.php|.php|/app" replace="{path='site_index'}||{path='site_index'}app/" multiple="yes"}
        {exp:switchee variable="{channel_name}" parse="inward"}
            {case value="responsive"}
                {exp:allow_eecode embed="yes"}
                    {responsive_body_{language_code}}
                {/exp:allow_eecode}
            {/case}
            {case value="multi_version"}
                <?php
                    if(userAgent($_SERVER['HTTP_USER_AGENT']) == "mobile"){
                ?>
                        {mobile_body_{language_code}}
                <?php
                    } else{
                ?>
                        {normal_body_{language_code}}
                <?
                    }
                ?>
            {/case}
        {/exp:switchee}
    {/exp:replace_plus}
{/exp:channel:entries}

</html>

that's the code, a bit complicate, but it work in other parts. the problem is in case responsive, where you can see {exp:allow_eecode embed="yes"}. in that field i have an embed like {embed="include/.newslist"} and in my .newslist template I have:

test {language_code}

{exp:channel:entries channel="news"}
    {news_title_{language_code}}
    test 2
{/exp:channel:entries}

But I can see only "test it" in my responsive entry.

I have one news and it seems to be all fine. I can't got it.

SOLUTION:

adding dynamic="off" in embedded entries tag:

{exp:channel:entries channel="news" dynamic="off"}
    {news_title_{language_code}}
    test 2
{/exp:channel:entries}
2

You can try Allow EE Code

{exp:channel:entries channel="my_channel"}  
    {exp:allow_eecode}
        {my_field}
    {/exp:allow_eecode}
{/exp:channel:entries}
5
  • looks awesome but just doesn't work! should i use some particular type of field or text formatting? I use textarea and "none" formatting and I continue to see unparsed ee tag. – vangogh Feb 7 '14 at 15:00
  • yes, I use the same fieldtype. For example next page is going from entry- demo-ee.com/examples/view/qr-codes-generator. If you show you template, possible I can advice you something more. – Max Lazar Feb 7 '14 at 15:55
  • if I use in my field some code like {language_code} or {entry_id} it is not parsed. I just added the parameter embed="yes" and I inserted an embed in my field: It works! But if insert in that embedde template some other code like just simple {exp:channel:entries} it does not work, so it's very usefull. – vangogh Feb 7 '14 at 16:15
  • Well, thanks a lot. i think that i'll change all and i'll use ajax for loading my dynamic content... it's even better. – vangogh Feb 7 '14 at 16:41
  • ok. But just for reference - {exp:channel:entries} must works also fine. On demo-ee I used it in example with maps. If you show you template code possible I can find issue. – Max Lazar Feb 7 '14 at 17:11
0
<?php
    require_once "php.include/user_agent.inc.php";
?>
{embed="include/.head"}

{if segment_1 == ""}
    {exp:channel:entries channel="index" limit="1"} 
        {exp:replace_plus find="index.php|.php|/app" replace="{path='site_index'}||{path='site_index'}app/" multiple="yes"}
            {responsive_body_{language_code}}
        {/exp:replace_plus}
    {/exp:channel:entries}
{/if}

{exp:channel:entries channel="multi_version|responsive" limit="1" require_entry="yes"}
    {if segment_1 != ""}
        {if no_results}
            {redirect="404"}
        {/if}
    {/if}
    {exp:replace_plus find="index.php|.php|/app" replace="{path='site_index'}||{path='site_index'}app/" multiple="yes"}
        {exp:switchee variable="{channel_name}" parse="inward"}
            {case value="responsive"}
                {exp:allow_eecode embed="yes"}
                    {responsive_body_{language_code}}
                {/exp:allow_eecode}
            {/case}
            {case value="multi_version"}
                <?php
                    if(userAgent($_SERVER['HTTP_USER_AGENT']) == "mobile"){
                ?>
                        {mobile_body_{language_code}}
                <?php
                    } else{
                ?>
                        {normal_body_{language_code}}
                <?
                    }
                ?>
            {/case}
        {/exp:switchee}
    {/exp:replace_plus}
{/exp:channel:entries}

</html>

that's the code, a bit complicate, but it work in other parts. the problem is in case responsive, where you can see {exp:allow_eecode embed="yes"}. in that field i have an embed like {embed="include/.newslist"} and in my .newslist template I have:

test {language_code}

{exp:channel:entries channel="news"}
    {news_title_{language_code}}
    test 2
{/exp:channel:entries}

But I can see only "test it" in my responsive entry.

I have one news and it seems to be all fine. I can't got it.

3
  • If i rename my embet removing dot, and i open in browser include/newslist I can see the list! All is fine. – vangogh Feb 10 '14 at 8:56
  • did you try to add dynamic="off" into {exp:channel:entries channel="news"}? – Max Lazar Feb 10 '14 at 9:06
  • Great! p.s. btw better to add this question (because it is not answer) into your question body and close this answer. – Max Lazar Feb 10 '14 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.