Creating a Template

From HTML to Template

Coaster uses the blade templating engine from Laravel 5. To create a new template, create a new file with the .blade.php extension within the templates folder. Next, you will need to decide on the layout of your template, will it inherit sections from a past template (commonly a header and footer), or will it have a completely new layout? Other things to take into account when creating a new template are what blocks are required and how they are to be composed. 

Template Locations







An example of a default homepage layout can be seen below:

{!! PageBuilder::section('head') !!}

{!! PageBuilder::block('banners') !!}

<section id="second">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <h2>{!! PageBuilder::block('title') !!}</h2>
                {!! PageBuilder::block('content') !!}
        <!-- /.row -->
    <!-- /.container -->
<!-- /.second -->

{!! PageBuilder::section('footer') !!}

The above highlights a basic homepage template consisting of three blocks and two sections that are likely to be reused throughout the site. When this template is loaded on the frontend it will look for and load the head and footer sections found within the sections folder. If these files do not exist then you'll likely encounter an error. The title block is pretty self-explanatory in that it returns the title of the page, this can be contained within the header tag of your choice, for example <h1>. The content block returns the page's text, this is already format thanks to TinyMCE and doesn't require any further formatting.

Modern Framework

Based on Laravel 5

Constant development

Additional features always being planned/researched

Open source

"git" involved

Latest from the blog

read more

read more

read more