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.

Embedding weblog entries

October 12, 2010 2:31pm

Subscribe [2]
  • #1 / Oct 12, 2010 2:31pm

    MAYO

    53 posts

    What im trying to achieve is a ‘sub template’ which will hold the style of a weblog entry. So far i am using this:

    {exp:weblog:entries weblog="{weblog}" category="{category_id}" dynamic="off" limit="20"}
    
        <li{if count == 4 OR count == 8 OR count == total_results} class="last"{/if}>
            <a href="http://{homepage}/shop/{segment_2}/{url_title}/" title="{title}">_            {exp:imgsizer:size src="{product-image-main}" width="226" height="150" alt="{title}"}_        </a>
            <strong>{title}</strong>
            {if product-sale}
                <span class="product-sale">[SALE] {product-sale-price}</span>
            {if:else}
                £{product-single-price}
            {/if}
            <a href="#" title="#">Add to cart</a>
        </li>
            
        {/exp:weblog:entries}

    What id like that to look like is something such as:

    {exp:weblog:entries weblog="{weblog}" category="{category_id}" dynamic="off" limit="20"}
    
    {embed="includes/.entry"}
            
        {/exp:weblog:entries}

    It seems to work and pulls through the correct amount of entries. BUT instead of there being content, it just displays {title} as the tag?

    Any ideas?

  • #2 / Oct 13, 2010 8:45am

    Sue Crocker

    26054 posts

    Hi, MAYO. Have you seen the example on http://expressionengine.com/legacy_docs/templates/embedding_templates.html ?

    Basically you’d need to pass the value of title to the embed, so it knows what to do with it.

    {embed="includes/.entry" title="{title}"}

    and then you’d use:

    <strong>{embed:title}</strong>

    You’d also need to pass the other values you needed.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases