Closed faultylee closed 4 months ago
Inside base.html? You mean on every page?
No, I wanted to show table in one of the view, and that view loads a Django template that extends on my own base.html. If this works, I would want to do that for multiple views to display diff table, but having the same set of header/footer and navbar...etc
The alternative I have in mind is to put the table in an iframe of my view
Here's the docs for this: https://docs.iommi.rocks/en/latest/legacy_fbv.html
The ajax dispatch part especially you will want to read I think. I've had someone read that page and stop at the first section and then the table filters don't work. The handle_dispatch
part is what will make that work.
But in general the easier and nicer way is to create your own Style (https://docs.iommi.rocks/en/latest/styles.html#creating-a-custom-style) where you give iommi your base.html
, and then every iommi view after that will render cleanly inside your base.html
so all examples will transfer from the docs into your site with proper styling etc.
Nice, I didn't know what FBV was, and also didn't realized I can pass template into style, I kept thinking it was more CSS related. I'll give it a try for the next few days. Thanks!
Yea, Style in iommi is a lot more than CSS classes, although that's most of what you want to do in there. It's a system to apply default configuration to your entire project based on certain rules.
The iommi philosophy is that good defaults should be shipped with iommi, but also that you should easily be able to configure what good defaults mean to your specific project too. We don't want the config in iommi to be special, only reasonable defaults.
Legacy FBV works for me, exactly what I needed and I don't need filtering for now, so no ajax issue. Basically I'm trying to do a parent + children view. I'll explore Custom Style when I'm done with the basics and want to move on to handle more complex use cases.
Thank you for the support and responses. I'll close the issue now.
Cool. I think you'll find that defining your own custom Style will lead to the docs making much more sense :P
Hi, thanks for creating this great add-on for Django.
I'm trying to have the Table display inside my existing
base.html
template. I prefer not having to construct that inPage
, but insert the table as ablock
in the template. Is that something that is supported? I can't find any information around this, not in existing issues or from google search.