Skip to content

Commit c36d83e

Browse files
committed
[Ui] Add a full layout
1 parent d2c9068 commit c36d83e

File tree

7 files changed

+130
-0
lines changed

7 files changed

+130
-0
lines changed

config/routes.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@ index:
33
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController
44
defaults:
55
template: base.html.twig
6+
7+
admin_cms_simple_page:
8+
path: /admin/cms/page/simple
9+
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController
10+
defaults:
11+
template: 'cms/page/simple.html.twig'
12+
13+
admin_cms_page_with_hooks:
14+
path: /admin/cms/page/with_hooks
15+
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController
16+
defaults:
17+
template: 'cms/page/with_hooks.html.twig'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/*
3+
* This file is part of the Sylius package.
4+
*
5+
* (c) Sylius Sp. z o.o.
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
declare(strict_types=1);
12+
13+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
14+
15+
return static function (ContainerConfigurator $container): void {
16+
$container->extension('sylius_twig_hooks', [
17+
'hooks' => [
18+
'app.cms_page#navbar' => [
19+
'content' => [
20+
'enabled' => false,
21+
],
22+
],
23+
'app.cms_page#content' => [
24+
'body' => [
25+
'template' => 'cms/page/with_hooks/body.html.twig',
26+
],
27+
],
28+
],
29+
]);
30+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends '@SyliusAdminUi/base.html.twig' %}
2+
3+
{% set prefixes = prefixes|default({})|merge([
4+
'sylius_admin.common.layout.full',
5+
]) %}
6+
7+
{% block body %}
8+
{% block sidebar %}
9+
{% hook '#sidebar' with {_prefixes: prefixes} %}
10+
{% endblock %}
11+
12+
{% block navbar %}
13+
{% hook '#navbar' with {_prefixes: prefixes} %}
14+
{% endblock %}
15+
16+
{% block content %}
17+
{% hook '#content' with {_prefixes: prefixes} %}
18+
{% endblock %}
19+
20+
{% block footer %}
21+
{% hook '#footer' with {_prefixes: prefixes} %}
22+
{% endblock %}
23+
{% endblock %}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
15+
16+
return static function (ContainerConfigurator $container): void {
17+
$container->extension('sylius_twig_hooks', [
18+
'hooks' => [
19+
'sylius_admin.common.layout.full#sidebar' => [
20+
'content' => [
21+
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/sidebar.html.twig',
22+
],
23+
],
24+
'sylius_admin.common.layout.full#navbar' => [
25+
'content' => [
26+
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/navbar.html.twig',
27+
],
28+
],
29+
'sylius_admin.common.layout.full#footer' => [
30+
'content' => [
31+
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content/footer.html.twig',
32+
],
33+
],
34+
],
35+
]);
36+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends '@SyliusAdminUi/layout/full.html.twig' %}
2+
3+
{% block content %}
4+
<div class="page-wrapper">
5+
<div class="page-body">
6+
<div class="container-xl">
7+
<div class="row">
8+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac felis nec sapien interdum luctus. Integer non sapien in urna faucibus pharetra. Vivamus vitae justo at arcu gravida aliquam. Sed congue eros id dolor faucibus, in iaculis arcu lacinia.</p>
9+
<h3>Section</h3>
10+
<p>Phasellus euismod, justo in facilisis lacinia, massa arcu convallis libero, sed consequat dolor nisl sit amet libero. Aenean euismod sem vel turpis ultrices, vitae laoreet leo sodales.</p>
11+
</div>
12+
</div>
13+
</div>
14+
</div>
15+
{% endblock %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends '@SyliusAdminUi/layout/full.html.twig' %}
2+
3+
{% set prefixes = ['app.cms_page'] %}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="page-wrapper">
2+
<div class="page-body">
3+
<div class="container-xl">
4+
<div class="row">
5+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac felis nec sapien interdum luctus. Integer non sapien in urna faucibus pharetra. Vivamus vitae justo at arcu gravida aliquam. Sed congue eros id dolor faucibus, in iaculis arcu lacinia.</p>
6+
<h3>Section</h3>
7+
<p>Phasellus euismod, justo in facilisis lacinia, massa arcu convallis libero, sed consequat dolor nisl sit amet libero. Aenean euismod sem vel turpis ultrices, vitae laoreet leo sodales.</p>
8+
</div>
9+
</div>
10+
</div>
11+
</div>

0 commit comments

Comments
 (0)