Alexander Solonik Alexander Solonik - 5 months ago 71
Twig Question

what exactly is haswidgets and widgets in bolt (or twig rather )?

I was just going through the Default theme of bolt CMS, and i came actoss the following lines of code:

{% if haswidgets('aside_top') %}

{{ widgets('aside_top') }}

{% else %}

I googled
twig haswidgets
and also
twig widgets
, but i could't find anything.

can somebody explain what these two methods are ? and what exactly do they do ?


They are a feature of Bolt. Extensions can push content to specific places in the backend and also to some places in the frontend, as long as the theme supports that. They are called widgets. the haswidgets() and widgets() twig functions are for checking and displaying them.

You can find more info here and here