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 about segment variables in embeds

July 06, 2007 7:10am

Subscribe [1]
  • #1 / Jul 06, 2007 7:10am

    stinhambo

    1268 posts

    I have used a segment variable inside an embed and according to the Debugging template it is parsing fine.

    But the contents of the template aren’t bringing in anything useful. Here is my code -

    {exp:weblog:entries weblog="{segment_1}"}
        <div class="product">
            <div class="product-photo">
                {matting_photo}
            </div> <!-- product-photo -->
            <div class="product-details">
                {embed="{segment_1}/product_box"}
            </div> <!-- product-details -->
        </div> <!-- product -->
    {/exp:weblog:entries}

    and this is the contents of the embed mentioned earlier -

    <h4 class="product-title">{title}</h4>
    {if matting_sku}Product Code: {matting_sku}{/if}
    {if matting_description}{matting_description}{/if}
    {if matting_link}<a href="http://{matting_link}?keepThis=true&TB_iframe=true&height=500&width=770" class="thickbox">View Offsite Product Information</a>{/if}
    <ul class="product-specs">
        {if matting_dimension}<li>Dimensions: {matting_dimension}</li>{/if}
        {if matting_guage}<li>Guage: {matting_guage}</li>{/if}
        {if matting_length}<li>Length: {matting_length}</li>{/if}
        {if matting_width}<li>Width: {matting_width}</li>{/if}
        {if matting_lip != ""}<li>Lip?: {matting_lip}</li>{/if}
        {if matting_type == "Smooth" OR matting_type == "Spiked"}<li>Type: {matting_type}</li>{/if}
    </ul>

    Is there a reason the custom fields in the embed aren’t parsing?

  • #2 / Jul 06, 2007 7:21am

    stinhambo

    1268 posts

    I just grabbed the all of the code including the {exp…} and chucked it into an embed. Works like a dream now!!

    I love embeds, makes for more portable code 😊

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

ExpressionEngine News!

#eecms, #events, #releases