J
J
JefAir2020-05-25 17:38:56
Twig
JefAir, 2020-05-25 17:38:56

How to add variable in partial October cms path?

October cms has partial https://octobercms.com/docs/cms/partials
, they are displayed like this:

<div class="sidebar">
    {% partial "sidebar/sidebar-contacts" %}
</div>

I have some variable that is displayed on the page like this:
{{ post.title }}
Can you please tell me how can I substitute this variable in the partial path?
Wrong option:

<div class="sidebar">
    {% partial "sidebar/{{ post.title }}" %}
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Khaetsky, 2020-05-26
@ReaZzon

Hello, we recently wrote on our blog how to do this.
https://biz-mark.ru/blog/web-razrabotka/konkatenac...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question