Skip to content

Instantly share code, notes, and snippets.

@Dmi3yy
Created November 17, 2019 09:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dmi3yy/2da17345eacacbe04a89e8c1cc53f348 to your computer and use it in GitHub Desktop.
Save Dmi3yy/2da17345eacacbe04a89e8c1cc53f348 to your computer and use it in GitHub Desktop.
Evolution CMS Lessons: Templates part 1
1 Templates 1 part
Подключаем debug и tracy:
core/custom/config/app/debug.php
<?php return true;
core/custom/config/tracy/active.php
<?php return 'manager';
Настроить 7. 2 и External Evo:
Приоритетность шаблонов:
1. tpl-3_doc-5.blade.php - use this if resource id=5 and resource template=3;
2. doc-5.blade.php - use this if resource id=5;
3. tpl-3.blade.php - use this if resource template=3;
4. example.blade.php - use this if resource templatealias = example;
5. if not found any match use template from DB
Стандартные элементы EVO и Blade:
<h1>{{ $documentObject['pagetitle'] }}</h1>
<h2>{{ $modx->documentObject['pagetitle'] }}</h2>
<p>{{ $documentObject['titl'] }}</p>
<p>{{ $modx->documentObject['titl']['1'] }}</p>
<p>@evoParser($documentObject['titl'])</p>
<p>@evoParser('[*pagetitle*] [(site_name)] [[DocInfo]] [!DocInfo!] @{{chunkFromDb}}')</p>
<p>{{ urlProcessor::makeUrl('2') }}</p>
<p>@makeUrl('2')</p>
<p>{{ $modx->getConfig('site_name') }}</p>
<p>{{ $modx->getChunk('chunkFromDb') }}</p>
<p>@include('partials.chunk', ['some' => 'data'])</p>
<p>{{ $modx->runSnippet('DocInfo',['docid' => '2']) }}</p>
<p>{{ $modx->runSnippet('DocInfo',['docid' => '2', 'field'=>'content'], '360', 'forAllsite') }}</p>
<p>{!! $modx->runSnippet('DocInfo',['docid' => '2', 'field'=>'content'], '360', 'forAllsite') !!}</p>
<hr>
{!! $modx->runSnippet('DocLister',[
'parents' => '2',
'tpl'=>'@CODE: [+pagetitle+]<br>'
])
!!}
<hr>
{!! $modx->runSnippet('DocLister',[
'parents' => '2',
'tpl' => '@B_FILE:partials/doc-tpl',
])
!!}
<hr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment