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.

Question regarding passing parms to embeded gallery templates

August 20, 2007 4:51pm

Subscribe [1]
  • #1 / Aug 20, 2007 4:51pm

    c.emerson

    36 posts

    I’m finally delving into use of embedded & hidden templates - very nice features! Am also setting up a gallery for the 1st time for an upcoming conference so I have the ability to work on this on a site that’s not yet live.

    There’s something simple I think I’m missing, though, regarding passing parameters to an embedded template that I hope someone can help with.

    In my gallery index page I have

    {embed="site/.my_Gallery_header" show_title="Conference2007"}

    Within the template .my_Gallery_header in the site template group, I have the following to display the title I’m thinking I can pass into the header template:

    <title>{embed:show_title} Photo Gallery</title>

    What do I need to modify in my code to have the title show up as “Conference2007 Photo Gallery” Currently, the parm isn’t getting resolved and shows up as

    {embed:show_title} Photo Gallery

    or am I misunderstanding the way this works?
    Thanks!
    -C

  • #2 / Aug 20, 2007 5:14pm

    Lisa Wess

    20502 posts

    C. are the details in your sig accurate? I ask because I just basically copy and pasted your code and it worked.

    I have abracadabra/index with this code:

    {embed="abracadabra/.test" show_title="Conference2007"}

    and abracadabra/.test with this code:

    {embed:show_title}

    And you can see that [url=http://www.lisajill.net/abracadabra/index/it works[/url] - so can you try these snippets on totally blank templates, the way I am, and see if it works?  Lets rule out anything else in your template and get the basic functionality working.

  • #3 / Aug 20, 2007 6:06pm

    c.emerson

    36 posts

    Sig is correct - although am in the process of going up to the 20070815 build.  😉

    2 questions:
    1) Should this work across different template groups… so say my gallery/index is in one template group and I want to embed an existing “fragment” from the site template group (not the gallery template group)? I did exactly what you did to the letter and the parm shows up perfectly on the index page when both are in the abracadabra template group.
    2) What “template type” should I be selecting for both new templates or does that make any difference? 

    Thank you!

  • #4 / Aug 20, 2007 6:13pm

    c.emerson

    36 posts

    Answered my own questions:
    1) Yes - works fine across template groups.
    2) Yes - template type makes a difference. Had incorrectly set the embedded code with the parm to “static” instead of “web page”. Once fixed, worked perfectly.
    Thank again, Lisa!

  • #5 / Aug 20, 2007 6:22pm

    Lisa Wess

    20502 posts

    Oh yes, template type definitely matters. =)  Glad you got it working!

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

ExpressionEngine News!

#eecms, #events, #releases