Я только что читал выборку контента в Bolt ЗДЕСЬ , что дало мне четкое представление о том, как работает setcontent
. Теперь я наткнулся на следующий код в шаблоне _aside.twig в теме болта по умолчанию:
<div class="panel">
{# The next section attempts to fill the panel in the sidebar with the contents of the
'about-us'-block, if it exists. First, attempt to fetch the block with slug 'about-us' #}
{% setcontent block = "block/about-us" %}
{# check if we have a title. If so, we know we have content to display. Otherwise, we will
output a default text, telling the user to create the 'blocks' in the backend. #}
{% if block.title is defined %}
<h5>{{ block.title }}</h5>
{{ block.content }}
{% if link(block.contentlink) or block.editlink() %}
<p>
{{ link(block.contentlink, __('general.phrase.read-more')) }} /
<a href="{{ block.editlink() }}">{{ __('general.phrase.edit') }}</a>
</p>
{% endif %}
{% else %}
<h5>{{ __('general.phrase.missing-about-page') }}</h5>
<p>{{ __('general.phrase.missing-about-page-block') }}</p>
{% endif %}
</div>
Мой вопрос касается следующей строки кода:
{% setcontent block = "block/about-us" %}
Откуда "block/about-us"
??