-
I'm currently using Django Cotton in a project and have encountered an issue. I'm trying to create a layout with a main content area and a sidebar on the right. The main content includes a table that will be reused across multiple pages. Each page will have its own columns and data, and I want to use blocks ({% block name %}) for the table rows so that I can replace them with HTMX responses. However, when returning an HTMX template using django-render-block, it seems that the block inside the component isn't being detected. Does Django Cotton support the use of template blocks ({% block name %}) in this context? If not, is there a recommended workaround for achieving this functionality? Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Yeah so I don't think blocks will work with cotton. I might suggest you reach for django-template-partials instead - I know a couple of cotton users also use it with that package. |
Beta Was this translation helpful? Give feedback.
-
So after trying template partials I wasn't successful in making them both work. The issue is that the one that comes last in Installed Apps work but the other doesn't. I also tried SimpleAppConfig way but didn't work either. I might be missing something here that's why I had to add this comment even though it was closed. |
Beta Was this translation helpful? Give feedback.
-
My bad. How did I not see that! Thanks a lot. Now they're both working |
Beta Was this translation helpful? Give feedback.
Did you see the setup guide here https://django-cotton.com/docs/django-template-partials