0

Is it possible to have Channel Entry as a text input be used dynamically to include a design template? In other words, something like:

{exp:channel:entries channel="mychannel" limit="1"}
    {embed="embeds/{myentryfield}"}
{/exp:channel:entries}

OR some other similar method to accomplish the same task.

12
  • Do you know an embed is a fully parsed template? Why do you wanna do this? Just to avoid to repeat code? If so, there are better ways of do that.
    – Sobral
    Nov 3 '16 at 20:56
  • I have a channel that indicates images, videos, text, etc. But now I have a section with its own HTML. I want the entry to say "addthistemplate" and it inserts the HTML template
    – The Hawk
    Nov 3 '16 at 21:03
  • Is there dynamic content on this embed?
    – Sobral
    Nov 3 '16 at 21:06
  • No, it will be just static html
    – The Hawk
    Nov 3 '16 at 21:06
  • It's a matrix...so one column is the type (image,text,video) and the other column is the content (image name, video name, or text)
    – The Hawk
    Nov 3 '16 at 21:07
0

I have a file with html content in a channel entry. Say the name of the field in the entry is {myfile}. The value of {myfile} I can choose since in EE. If it were "/mycontent/myfile.html"

In the template, could you enable PHP and say this:

<?php include_once("{myfile}") ?>

which would be the same as

<?php include_once("/mycontent/myfile.html"); ?>

Would that work?

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.