how does partials module work?

stevenweijdt - 1 month ago

I've tried to add this to the view.twig file of the pages module: {% include "partials::blabla" %}

I also tried to add it to the content field of a page. blabla is the slug of the partial I made. There's no documentation. So I have no idea how and where to use the partials I made. Templates module just works.

ryanthompson - 1 month ago

I think I might go ahead and release document this one.. test er our for me! We've used it in production a few times but will be nice to have more eyes on it:

{{ partial($slug) }}

If a partial is a relationship - then you can do like:

{{ page.partial|raw }}

stevenweijdt - 1 month ago

I've added this to the view.twig and to the content type of a page: {{ partial($slug) }} {{ partial("blabla") }} {{ partial(blabla) }}

I'm trying everything. Doesn't seem to work

stevenweijdt - 1 month ago

So $slug is a string. It's the slug name you can find here:

(you need to create a partial first there. If you already have one, click on edit) When you call your partial My Partial, the slug will become my_partial.

if you go here you find the default type for a page. Add the partial code to the layout field on the bottom of the page like this:

{{ partial('my_partial') }}

You can also edit a page and add the {{ partial('my_partial') }} to the content field:

That's the welcome page that comes out of the box with pyro.