June 23, 2017 at 5:24 pm

Flexible blade setup

Once you have noticed the breeze the blade templating engine will bring into your templates, it’s about time to share a flexible template setup. I’ll share mine below but it’s by far the best setup in every situation.

Our file structure:

- master.blade.php

- header.blade.php
- menu.blade.php

- page1.blade.php
- page2.blade.php


<!DOCTYPE html>
<html lang="">
   <meta charset="utf-8">
   <meta name="description" content="@yield('description')">
   <meta name="keywords" content="@yield('keywords')" />





@section('title', 'This is an individual page title')
@section('description', 'This is a description')
@section('keywords',	'Keyword 1, Keyword 2, Keyword 3')


   <script src="//"></script>

  {{-- Other scripts --}}

This file will contain everything related to the header, like logo, contact info, title and subtitle found inside the header, …

As the file says, this contains our menu. I’d like to have this separated because I need to edit this frequently and don’t want the header file to get to complex.

I encourage you to go out, experiment and set this layout structure to your own hand, the best workflow is the one you are the most comfortable with, good luck!

0 likes blade , templates
Share: / / /