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.

Refactoring - Snippet or embedded template?

November 30, 2010 9:29am

Subscribe [3]
  • #1 / Nov 30, 2010 9:29am

    carvingCode

    380 posts

    Hi -

    I’m refactoring template code and am wondering, from an efficiency standpoint, when best to use an embedded template vs a Snippet.

    Is a Snippet always more efficient over an embedded template if the include template code can run within the Snippet?

    Example:  Is it more efficient to include all common header and top navigation in one Snippet or one embedded template?

    TIA

  • #2 / Nov 30, 2010 10:53am

    Lisa Wess

    20502 posts

    Hi, cC - did you see the user guide on snippets as well as the thread Kurt linked regarding performance benefits?

  • #3 / Nov 30, 2010 11:15am

    carvingCode

    380 posts

    Thanks.  Yes, I had read that, probably back in May. Things get a bit fuzzy after awhile though and I’ve got a lot of refactoring to do. So, wanted to double check that I was on the right track.

    Thanks.

  • #4 / Nov 30, 2010 2:49pm

    narration

    773 posts

    carvingCode, this is the ‘snippet’ you probably most want, for your good question:

    Lisa on Snippet performance vs. embeds

    Regards,
    Clive

  • #5 / Dec 01, 2010 5:54pm

    Tony Geer

    253 posts

    Mike just posted an article with some performance comparisons too: http://www.train-ee.com/courseware/free-tutorials/comments/snippets-or-embedded-templates/

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

ExpressionEngine News!

#eecms, #events, #releases