Overview

Once you familiarise yourself with the concepts of fields, sections and entries you can start writing your own front end templates. At the heart of the IgnitedCMS engine is a simplified template engine. A front end way of getting data out and dumping it to your views.


There are only a few rules you need to know when creating your own templates. You must include a layout.blade.php file which lives in the views folder, under custom. You can of course customise this to your own style and even include external css and js files.


But you MUST not rename or delete this file. It is the heart, if you like, of the main engine. As soon a you create a section, the name of your section will form the PHP name. For example,if you created a section called home, you need to create a PHP file called home.blade.php inside your custom folder.


resources
   - views
       - custom 
          - layout.blade.php
          - home.blade.php

Let's say you have a text field in your section called title.


To output this in home.blade.php all you would do is first create a layout.blade.php

file

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>title</title> </head> <body> @yield('content') </body> </html>

And a home.blade.php file

@extends('custom.layout') @section('content') {{ $title }} @endsection