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.

Tips and tricks to avoid creating similar templates for embedding?

June 21, 2011 5:58pm

Subscribe [2]
  • #1 / Jun 21, 2011 5:58pm

    brianearwood

    40 posts

    Hi everyone,

    On a couple of sites I have done, I ended up having to create two or more of the same embedded template, with differences in the EE Channel tag, as a work-around to the EE parse order. I have used conditional statements to select which template embed to use in a situation.

    In pursuit of DRY, are there any methods or tricks that you have found to alleviate some of this?

    Thanks for the help!
    Brian

  • #2 / Jun 21, 2011 6:04pm

    Matt:P

    277 posts

    Hi Brian

    Could you instead place the various Entry tags directly within their own Conditional Statements, on the main template. That way you only have one template (with the same number of conditions to satisfy before rendering) and comply with DRY at the same time…

    Capiche?

    Matt

  • #3 / Jun 21, 2011 6:27pm

    brianearwood

    40 posts

    Matt, do you mean to not embed the templates, to write it all out in one main template?

  • #4 / Jun 21, 2011 6:53pm

    Matt:P

    277 posts

    Hi Brian

    Yes, it achieves your DRY goal and (in my mind at least) wouldn’t put the system under any more strain than the method you describe above.

    Make sense?

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

ExpressionEngine News!

#eecms, #events, #releases