In all web applications, it’s easy to find developers copying code and not maintaining single source areas to provide content. Specifically with websites and web design, the need to have templates wrap content became apparent with static code represented in HTML. This static content and code duplication introduced such things as DHTML and SHTML, which allowed content to be included from the server and code / design to be re-used. Today, the concept of separation of data and design is very important, and with CMS’s we find MVC-like (Model-View-Controller) frameworks that lift a template and it’s dynamic functionality out of a multi-source environment and contained into a single source.
The design and the template are considered your “View” or your master layout. In Joomla, templates are driven via template folder and index.php where snippits of Joomla code are placed within a singular design. WordPress is very similar. Other CMS’s such as Confluence and ExpressionEngine require your templates to be built into the CMS system itself and driven via the database interaction. In all methods, template contain snippit includes that allow the re-use of common function and content. These snippits could include plugins, modules, self-sustatining applications, web service calls, social media interaction, and many other types of material, which must be agnostic of design and allow the template to re-shape the inserted codes design.
In MVC structures, design is abstracted out to a global location, called a “layout”. And with this layout, any web developer has the ability to modify every single page with the same template, in one location. In addition to having your layout in a single location, you have the ability to programmatically change your layout, based on conditions. For example a Mobile website may have a different layout than a Desktop website. If an entire web site design has to be redone, it is as simple as creating a new layout. And if you want to allow users the ability to have different layouts, depending on their settings, you can have them configure that with their own login or cookie credentials.
Here is what MVC means in the Joomla environment: