I’m using the latest Phoenix 1.7 RC with layouts based on Phoenix.Component
.
Is it possible to define optional slots in Live layouts?
(I’d like an optional :banner
slot available for any LiveView of my application)
I’m using the latest Phoenix 1.7 RC with layouts based on Phoenix.Component
.
Is it possible to define optional slots in Live layouts?
(I’d like an optional :banner
slot available for any LiveView of my application)
I don’t think the layouts mechanism supports slots. I’d probably make the layout a function component instead and use no layout, but wrap pages in
<.layout>
<:banner> … </:banner>
…
</.layout>
Thanks!
This was my workaround, I guess I will stick with it then!
I have now 3 levels of layout in my application, it’s a bit overkill
root.html
→ app.html
→ <.layout/>
You could skip app.html
if you have everything in your <.layout>
component.
I agree that I could
I won’t (because reasons), but I could