Book Image

Creating Concrete5 Themes

Book Image

Creating Concrete5 Themes

Overview of this book

Creating a concrete5 theme isn't complicated if there’s already a HTML document. There are only very few PHP functions you’ll have to add, but those are powerful and give you a lot of freedom. As you’ll learn to create mobile ready themes, you’ll start to see that there’s almost no limit in what you can do."Creating Concrete5 Themes" is a practical, hands-on guide that provides you with a number of examples that will teach you how to create powerful concrete5 themes, change the look of content block elements, and even make your site ready for mobile devices."Creating Concrete5 Themes" starts with a few words about the editing concept and architecture of concrete5 and then continues with the creation of a basic theme which gets extended with more and more elements until the theme is mobile ready.You will learn where to find the information necessary to get your own concrete5 site and then get a quick introduction to understand the idea of the in-site editing concept. We’ll then create a theme which is extended with features and more details as we progress. You’ll also see some examples to show you the process of overriding elements from the core without losing the ability to upgrade concrete5 in the future. Once we’ve customized every element in concrete5 to build a complete theme, we’ll have a look at responsive techniques to make your site ready for small screen devices such as mobile phones and tablets.  
Table of Contents (13 chapters)
Creating concrete5 Themes
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

What happens when a page is rendered


Unlike a site with static HTML files, the content in concrete5 is stored in a database. If you view a page, all of that content needs to find its way to the visitor's browser. Working with FTP is not going to work anymore and might be a bit unusual for those who haven't worked with a database-based CMS before.

To give you a rough overview about what actually happens when a page is viewed, here's the summarized flow when a page is requested:

  1. The visitor requests a page such as http://www.your-site.com/about/.

  2. Apache gets a request, and assuming that you've enabled pretty URLs, it will parse a file called .htaccess in the root of your site. Here's a part of its content:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}/index.html !-f
    RewriteCond %{REQUEST_FILENAME}/index.php !-f
    RewriteRule . index.php [L]
  3. REQUEST_FILENAME contains the file that the user requested. –f means that we only executed the RewriteRule...