Layouts

Basics

Every integration has it’s own layout view and assets.
Currently all of the integrations layouts are in: resources/views/layouts/domains
The naming convetion is: [product_domain].blade.php . All of the dots should be replaces with underscores.
So for example if you want to create a layout for myintegration.test.com the layout should be: resources/views/layouts/domains/myintegration_test_com.blade.php

Assets

All of the scraped assets like images,fonts,css and js files are located in storage/app/public/assets/[product_domain] To get a public url for those files the $static_files_url variable is used. It’s available in all layouts and holds the public url for the integration’s assets. Example use:

<link rel="icon" type="image/png" href="{{$static_files_url}}images/favicon-16x16.png" sizes="16x16" />
<script async src="{{$static_files_url}}js/PAZ_single.js"></script>

Important placeholders

These placeholders are usualy generated by the header/footer scripts reponsible for the scraping of the client’s header/footer and are responsible for pushing our code(css and js) and content into the client’s header/footer. Here a list of the stacks and yields we’re using. If some of our code is not loaded (in terms of css/js) you should check if the integration’s layout is having those @stack and @yield tags:

Each layout should have the following @stack groups and @yield placeholders:

@yield(’title')

Placeholder for dynamically setting the title:

<title>@yield('title')</title>
<meta property="og:title" content="@yield('title')">

Example use of the title within article.blade.php page:

@section('title')
    @if(isset($article['meta_title']) && null != $article['meta_title'])
        {{$article['meta_title']}}
    @else
        {{$article['name']}}
    @endif

    @if(isset($category) && isset($category['name']) && null != $category['name'])
    - {{$category['name']}}
    @endif
@endsection

@yield(‘content’)

Defines the place in which we deliver our content Example:

        <main id="main" class="d-flex flex-column gap-2 text-break">@yield('content')</main>

@yield(‘description’)

Use for dynamic description meta tag and og:description tags Example:

    <meta content="@yield('description')" name="description">

@yield(‘robots’)

<meta name="robots" content="@yield('robots')">

Example robots for article page:


@section('robots')
    @if(isset($article) && isset($article['robots']))
        {{config('options.robots')[$article['robots']]}}
    @else
        index,follow
    @endif
@endsection

@stack(’top_css')

This one should at before the tag or right at the begining of it.

@stack(‘head’) @stack(‘css’) @stack(‘bottom_css’)

These should be right before the closing of the head tag:

...
@stack('head') @stack('css') @stack('bottom_css')
</head>

@stack(’top_js’) @stack(‘js’) @stack(‘bottom_js’)

Those should be right before the closing of the body tag

@stack('top_js') @stack('js') @stack('bottom_js')
</body>