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.

embeds not showing when page created using page module

August 09, 2010 2:43pm

Subscribe [6]
  • #1 / Aug 09, 2010 2:43pm

    DonovanCreative

    3 posts

    Hello,

    I am expirmenting with EE and I have created lots of templates and
    entries through the Channels and everything is ok. But I have an
    issue. When I build for a client, the way it works now is if you want
    a new page you must create the Channel, then create a template to get the data from that Channel.

    So I was experimenting with the Pages module hoping that Creating
    multiple pages from 1 template would solve the problem. But when I do
    this, nothing that is “Embeded” shows up? I have a few content
    sections like the sidebar, etc that is included using

    {embed=embeds/latest_news}

    But nothing appears on the pages created using the pages module?

    Do you have any insight into this?

    Landon Poburan

  • #2 / Aug 09, 2010 4:23pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Can you show us in a little more detail what you are attempting to do? A link, perhaps?

  • #3 / Aug 09, 2010 5:05pm

    DonovanCreative

    3 posts

    Version: v2.1.0

    I am building a website and many pages will be built off of the same template. So I am using the pages module.

    I have a “Static Page” Channel and a “Static Page” Template group and am using the index template calling the info with {exp:channel:entries channel="static_page"} then just outputting {body}.

    I created a Services page with the url of /services/. I can hit index.php/services no problem and it displays the content BUT a bunch of the embeds are not displaying. ({embed=embeds/latest_news} and {embed=embeds/latest_products}). I have the exact same template just using a different channel and just went to publish -> to that channel and create a page and that displays the embeds fine. It seems like with you use the URL “template_group/template” it works but using the “page” url which doesn’t go by that scheme causes issues.

    Landon

  • #4 / Aug 10, 2010 2:35am

    John Henry Donovan

    12339 posts

    Landon,

    Can you show us for example what’s in embeds/latest_news?

  • #5 / Aug 10, 2010 12:08pm

    DonovanCreative

    3 posts

    {exp:channel:entries channel="latest_news" limit="1" orderby="date" sort="desc"}
    <strong>{title}</strong>            
    {latest_news_excerpt}
    <a href="http://{permalink}" title="{title}">Read more…</a>
    {/exp:channel:entries}
  • #6 / Aug 11, 2010 3:17am

    John Henry Donovan

    12339 posts

    DonovanCreative,

    Can you add dynamic=“no” to you channel:entries tag in the embed and see if that works for you

    {exp:channel:entries channel="latest_news" limit="1" orderby="date" sort="desc" dynamic="no"}
    <strong>{title}</strong>            
    {latest_news_excerpt}
    <a href="http://{permalink}" title="{title}">Read more…</a>
    {/exp:channel:entries}
  • #7 / Aug 11, 2010 12:05pm

    DonovanCreative

    3 posts

    Thank you. That seemed to fix the issue. Would you be able to explain why that fixed it so I have a better understanding?

    Since the embeds worked on some pages but pages created through the “pages” module they did not work on.

    Thank you for your help.
    Landon

  • #8 / Aug 11, 2010 3:33pm

    Ingmar

    29245 posts

    Normally EE takes the URL title into account. If you want it not to using dynamic=“no” is the way to go.

  • #9 / Oct 09, 2011 6:29pm

    JPDesignDev

    20 posts

    Normally EE takes the URL title into account. If you want it not to using dynamic=“no” is the way to go.

    I understand this concept generally speaking, but there is something weird to me about this.

    I created a template under site/index, which is the Index of my site. I had an embed working perfectly without the use of dynamic=“no”.

    Once I created a Page using the Pages module which points to my site root (/), everything in this template rendered properly except the channel:entries tags. After reading this post, I tried dynamic=“no”, and it works perfectly. The only weird thing, to me at least, is that the URL never changed. Is there something else going on with dynamic=“no”, and the easy explanation is that it makes the tag not look at the URL title? Or, am I not thinking of this properly?

    Either way, the dynamic=“no” solution worked flawlessly, but I am just wondering.

  • #10 / Oct 10, 2011 4:51pm

    Kevin Smith

    4784 posts

    ...the easy explanation is that it makes the tag not look at the URL title…

    You’re correct. Using

    dynamic="no"

    tells the Channel Entries tag not to use any input from the URI string to help it dynamically determine which entry it should display.

    Does that make sense as an easy, always-true explanation?

  • #11 / Oct 10, 2011 5:01pm

    JPDesignDev

    20 posts

    Once I created a Page using the Pages module which points to my site root (/), everything in this template rendered properly except the channel:entries tags. After reading this post, I tried dynamic=“no”, and it works perfectly. The only weird thing, to me at least, is that the URL never changed. Is there something else going on with dynamic=“no”, and the easy explanation is that it makes the tag not look at the URL title? Or, am I not thinking of this properly?

    Yes. That explanation makes perfect sense to me in every scenario I have encountered in my short time with EE except this one. Nothing about the URI has changed here, so why does dynamic=“no” make a difference?

    I hope I am making sense here. Plead let me know if I am not.

  • #12 / Oct 11, 2011 10:40am

    Mark Bowen

    12637 posts

    Hi JPDesignDev,

    As you are pointing a page at the root of your site then probably what is happening here is that as there isn’t any URI information (no segments after the domain name) the Channel Entries Tag isn’t rendering as it isn’t finding any information in that way.

    You could test this by first taking out the dynamic=“no” parameter and then adding in this to your entries tag :

    {exp:channel:entries
     channel="default_site"
     limit="1"
     disable="member_data|trackbacks|categories|category_fields|pagination"}
    
    {if no_results}
    No entries found…
    {/if}
    
    {/exp:channel:entries}

    If you get No entries found… when you now visit your root page you will know that the Channel Entries Tag didn’t have enough information for it to render correctly thus why you need the dynamic=“no” parameter in order to get a result.

    Does that help?

    Thanks,

    Mark

     

  • #13 / Oct 11, 2011 12:31pm

    JPDesignDev

    20 posts

    Hmm… dynamic=“no” is only needed when I am using pages module to point to example.tld/.

    If I delete the pages module entry and revisit example.tld/ (same template I might add) dynamic=“no” is no longer needed.

    This is weird to me because there is no difference in URI information sent between the two. Either way, I don’t necessarily need support on this because it is working fine for me the way it is. I was just hinting at the notion that dynamic=“no” is probably doing a bit more than telling the tag not to look at URI. I am assuming that if it did nothing else, the channel tag would output the same information with or without dynamic=“no” at the site root.

    Again, I really do not need support on the matter, and I do not want to be difficult. I was just curious, I guess, and I thought the answer might be really simple. You know, if ain’t broke, don’t fix it, kind of a thing.

  • #14 / Oct 11, 2011 1:20pm

    Kevin Smith

    4784 posts

    No problem at all, JPDesignDev. Curiosity is a good thing! Sorry we didn’t have a better explanation for you.

    I’ll close this one up, but do let us know if there’s anything we can help with again in the future!

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

ExpressionEngine News!

#eecms, #events, #releases