How do you mix LiveView and regular templates?

I’m wondering what your strategies are for using both regular templates and LiveView templates in an application.

I have an applications where parts are handled with LiveView and other parts are handled with regular controllers. Now they both need to use some of the same layouts etc.

How do you manage your templates in a way that it doesn’t become a mess?

For example, at the moment I have 2 partials: _flash.html.eex and _live_flash.html.leex. They’re largerly the same, but one uses get_flash and the other one get_flash

And I’m getting in the same situation with the navigation bar.

So, how do you handle this?

2 Likes