Search code examples
expressionengine

EE2: embed not displaying properly


I've got a website with two channels, news and products.

Products are displayed using an embedded channel entries tag pair called marketing. The news articles are displayed using a regular channel entries tag pair.

When the user clicks on a news article, the website navigates to a new page (news/view) containing the contents of just the news article in question. The template also includes the embedded template containing the products tag pair. This is where the problem occurs: the only published item that displays is the news article. None of the products display on the news article template.

The homepage and 'news/view' mock-up:

{exp:channel:entries channel="news"}
    {title}
    <some markup>
    {body}
{/exp:channel:entries}
{embed="includes/marketing"} 

The marketing embedded template looks something like:

<some dividing markup>
{exp:channel:entries channel="products"}
<list markup>
   {product_image}
   {product_description}
</list markup>
{/exp:channel:entries}
</some dividing markup>

Since the homepage and the 'news/view' template are essentially the same, I have no idea why the products are displaying on the homepage and not the 'news/view' page.


Solution

  • I'm not entirely sure but try adding dynamic="no" to your channel:entries loop. This seems to resolve 99% of my EE problems :)

    {exp:channel:entries channel="products" dynamic="no"}