carltongibson / django-template-partials

Reusable named inline partials for the Django Template Language.
MIT License
387 stars 15 forks source link

Mention that partials must be defined inside the top-level template #44

Open matthiask opened 2 months ago

matthiask commented 2 months ago

As you can see I tried to do exotic things and failed. After thinking it over I'm sure it makes more sense to document this limitation than try to inherit partials.

carltongibson commented 2 months ago

Hi @matthiask, yes. Inheriting partials via extends is definitely out of scope. (It's a world of pain to even begin looking into 😅)

Using include here is the way.

It's not something I've wanted/needed to try but you could include a partial from the template you're extending without issue I'd suspect.

Let me just ponder the phrasing here but 👍