Create own frontpage layout
Note
Since version 2.6 we use BladeOne to render frontpage layouts.
In addition to existing layouts, you can always add your own.
To do this, create a file custom.blade.php
in the /Themes/default/portal_layouts
directory:
php
@empty ($context['lp_active_blocks'])
<div class="col-xs">
@endempty
<!-- <div> @dump($context['user']) </div> -->
<div class="lp_frontpage_articles article_custom">
{{ show_pagination() }}
@foreach ($context['lp_frontpage_articles'] as $article)
<div class="
col-xs-12 col-sm-6 col-md-4
col-lg-{{ $context['lp_frontpage_num_columns'] }}
col-xl-{{ $context['lp_frontpage_num_columns'] }}
">
<figure class="noticebox">
{!! parse_bbc('[code]' . print_r($article, true) . '[/code]') !!}
</figure>
</div>
@endforeach
{{ show_pagination('bottom') }}
</div>
@empty ($context['lp_active_blocks'])
</div>
@endempty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
After that you will see a new frontpage layout - Custom
- on the portal settings:
You can create as many such layouts as you want. Use debug.blade.php
and other layouts in /Themes/default/LightPortal/layouts
directory as examples.
To customize stylesheets, create a file portal_custom.css
in the /Themes/default/css
directory:
css
/* Custom layout */
.article_custom {
/* Your rules */
}
Tip
If you have created your own frontpage template and want to share it with the developer and other users, use https://codepen.io/pen/ or other similar resources.