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.

Embed Template w/in a Template

January 25, 2011 2:17pm

Subscribe [4]
  • #1 / Jan 25, 2011 2:17pm

    Color-ize

    27 posts

    v2.1.1 - © Copyright 2003 - 2010 EllisLab, Inc.
    Script executed in 0.4406 seconds - 42 SQL queries used - Build:  20101020

    I am embedding a Template within a template. This works correctly on the front page where you are actually loading the main content - no id required.
    However, when I go to pull in the template on the interior pages with the url
    http://www.sitename/index.php/page_name/ it will pull up the page - but it doesn’t pull up the embedded content. If I directly look at the template without specifying an ID it will pull up the embedded content fine along with the most recent entry. The only time it doesn’t work is when I want to specify which page to pull up.

    Is there something I am missing that doesn’t allow embedded content to pull up? Any suggestions helpful references besides the one I’ve been looking at here: http://ellislab.com/expressionengine/user-guide/templates/embedding_templates.html

    Thanks,
    Seth

  • #2 / Jan 25, 2011 2:42pm

    BigCItyShelts

    35 posts

    Shot in the dark: are you using the ‘dynamic’ attribute correctly on the embedded template?  If so, I could use more info about the problem.  Maybe post your template code…

  • #3 / Jan 25, 2011 2:56pm

    Color-ize

    27 posts

    I’m not sure what you mean by ‘dynamic attribute’?

    I have it embedded using: {embed="monthly_special/index"}. If that was what you were referring to.

  • #4 / Jan 25, 2011 2:58pm

    Ingmar

    29245 posts

    If I directly look at the template without specifying an ID it will pull up the embedded content fine along with the most recent entry. The only time it doesn’t work is when I want to specify which page to pull up.

    Try adding

    dynamic="no"

    to your code.

  • #5 / Jan 25, 2011 3:08pm

    Color-ize

    27 posts

    I added dynamic=“no” to the page - it still isn’t showing up except on the page that isn’t specifically pulled in. I only want one page to show at a time - so I have it set to limit it to one - do I need to limit it to one if I am only pulling on page in anyway?

    I’m really trying to wrap my head around this system, however, I learn more from hands on that from reading - so while I read the content on the training information I still don’t get what it really does until I see what it does for myself.

    Thanks for the assistance.
    Seth

  • #6 / Jan 25, 2011 3:53pm

    BigCItyShelts

    35 posts

    Well…  maybe I can address your scheme as a whole.  To accomplish a very simple homepage/interior page scheme, I would create two independent templates:

    main/index
    main/interior

    Neither would need to embed the other.

    Homepage would be accessed at: domaminname.com
    Interior pages would be accessed at: domianname.com/interior/entry_url_title

    That’s a nice “training-wheels” setup, if you’re new to EE.  Later you can start using segment variables to help clean up your URL.  Hope this helps!  After 1+ years with EE, I’m very happy with it.

  • #7 / Jan 25, 2011 4:01pm

    Color-ize

    27 posts

    Thanks for the responses BigCityShelts, however what I’m trying to do is a bit more complicated than just having an interior page and a home page. I do have those already set up.

    I want to make it so the end users (who will be updating the site) can easily just update the monthly specials for their site by adding a single entry. They are easily confused - so I’m trying to keep it as minimalistic in the backend as possible. So if they want to do a monthly special they just click create-entry-monthly special and it will update the site so it will have their monthly special updated throughout the site.

    This isn’t even the most complicated part - they also want to update a jQuery rotation with fresh images representing their services - I haven’t even gotten to figuring out how I’m going to do that - maybe in the end they won’t be able to update this after all. Who knows - however with these “Monthly Specials” I know it is possible. I might just be overcomplicating something - or missing a key step/element.

  • #8 / Jan 25, 2011 5:43pm

    Color-ize

    27 posts

    Got it! I wasn’t using the dynamic in the correct template. I went through all my templates and strategically added dynamic=“no” to each one and tested it, then removed it and went to the next one etc until I finally found the right one! So, Thanks a lot BigCityShelts - onto my next issue! 😊

  • #9 / Jan 26, 2011 9:35am

    Sue Crocker

    26054 posts

    Thanks for the assist, BigCityShelts.

    Color-ize - Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases