0

I am not sure if what I am trying to do is possible. I am definitely not succeeding.

What I need is to have a channel field that calls a template partial, preferably a text field where I can type in the name of the partial or a drop down menu, where the partial name can be selected.

The plan being that if in the entry form, the partial_name field was channel_x_partial, the channel_x_partial content would appear when the page is viewed in the browser.

The code below has not worked.

{exp:channel:entries channel="channel_name" limit="1" dynamic="no" entry_id="{structure:page:entry_id}" disable="member_data|pagination"}
    {partial_name}
{/exp:channel:entries}

Am I way off base? Would another type of embed work better? The catch is I need this to be dynamic as different entries would call different partials.

Thank you in advance even if it is to let me know I am way way off base!

Peter T

0

Providing your field short name is partial_name, have you tried this syntax?

{exp:channel:entries
    channel="channel_name"
    limit="1"
    dynamic="no"
    entry_id="{structure:page:entry_id}"
    disable="member_data|pagination"}

    {{partial_name}}

{/exp:channel:entries}

Another option is to just use conditionals based on the field value if that doesn't work:

{exp:channel:entries ... }

     {if partial_name == "partial_1"}
         {my_partial_1}
     {/if}

{/exp:channel:entries}

Other options are possible but we would need some more info, perhaps some expanded sample template code on what you want to accomplish.

| improve this answer | |

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.