Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Avoiding duplicate code in a custom template


You might have wondered why we always have to copy the whole template file in order to modify just a single line. While copying the file is okay, it makes sure the changes don't get lost when you update to a newer version of concrete5; there's an option to include an existing template in a new one.

This works nicely if you just want to wrap an existing template. Let's assume you want to add some CSS rules to a content block. You'll quickly realize that there's no wrapping DIV in it, which makes it hard to apply styles for the content block. You can override any paragraph but if that's not what you want to do you have to create a new template and add a surrounding DIV element.