Views

What are the views?

In Gentics Portal | essentials the views are the main components of the project. These files maintain the layout of the pages to render.

Views can be called from CMS pages by prefixing them with the project string. In that case, the profile view should be called as project::profile.

The file names must be the same as the view name ending with .blade.php, so in that case, it will be profile.blade.php.

The views are consist of HTML code and the Blade templating elements.

Layouts

It is possible to reuse views, by including a layout file.

Example: @extends('project::layouts.app') → this will include the layouts/app.blade.php view as base.

This base layout should contain sections, so you can fill these sections with content like:

@extends('project::layouts.app')
@section('content')
To be displayed in the content section
@endsection

As a minimal example, your layouts/app.blade.php should look like this:

<div class="content">
    @yield('content')
</div>

This will make the view include the contents from the section.

Variables

The Blade templating engine supports variables and codes. These templating elements can be evaluated between {{ }} braces.