ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Embedded template fields

January 20, 2011 11:51am

Subscribe [2]
  • #1 / Jan 20, 2011 11:51am

    I have a template with the following setup:

    {exp:channel:entries channel="home"}
    
    {embed="includes/contact_form"}
    
    {/exp:channel:entries}

    The embedded template contains a form and this form has the following hidden fields:

    <input type="hidden" name="source_title" value="{title}" />
    <input type="hidden" name="source_url" value="{page_uri}" />

    But the {title} and {page_uri} variables don’t get assigned.  Is this a scope issue?

    These variables work if I include the form as a snippet rather than an embedded template.  Is there a way to do it as an embedded template?

  • #2 / Jan 20, 2011 6:00pm

    Ingmar

    29245 posts

    Yes, it’s a scope issue. If you want to have access to the calling template’s values, as it were, you need to pass them on to the embed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases