Cms: Blade sections are not working

Created on 21 Nov 2019  路  4Comments  路  Source: statamic/cms

Hi.

Am I doing something wrong? I have a simple collection with two fields. I've set the layout and the view. Those are basic:
Layout

<html>
<head>
    <title>App Name - @yield('title', 'Default')</title>
</head>
<body>
<div class="container">
    @yield('body')
</div>
</body>
</html>

VIew

@extends('layouts.app')

@section('body')
    <p>This is my body content.</p>
@endsection

The generated HTML looks like this:

<html>
<head>
    <title>App Name - Default</title>
</head>
<body>
<div class="container">
    </div>
</body>
</html>

Can't make it to show something from the view in the layout. I tried putting it outside of a section, tried without the @extends on top, nothing makes the view render, only the layout is shown.

bug

Most helpful comment

Trying to pitch Statamic to my company when v3 launches. Nice product so far :)

All 4 comments

Nice catch! It's assuming you're still doing the whole layout/template thing that Antlers does, which is interfering with the proper behavior. We've popped the hood and have begun to wangjangle the wires. Stay tuned.

Trying to pitch Statamic to my company when v3 launches. Nice product so far :)

Thanks! I'm working on a "The Statamic Pitch" page that lists the specific benefits of switching to Statamic, positioned towards non-technical folks, owners, and the like. Keep your eye out for that, maybe it'll help nudge you that much closer to victory. 馃

I can test right now by commenting out line 136 in \Statamic\Http\Responses\DataResponse

Was this page helpful?
0 / 5 - 0 ratings