O'Reilly logo

Building Websites with ExpressionEngine 2 by Leonard Murphy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Avoiding repetition

You have already created an embedded template that saves you from having lots of templates with the same basic HTML code inside. When working with templates in ExpressionEngine, it's best to avoid code repetition of code as much as possible — whether the repetition is within a single template or across multiple templates.

Any situation where code is repeated can be a major headache, should you ever wish to update that code; instead of being able to make an update in a single location, you instead have multiple places to make the same update, increasing the likelihood that you miss one. On a small site with only one or two templates, it's easy to manage code that is repeated, but as your site grows, having the same code in more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required