As you might have seen in Phoenix liveview multitenancy. I’m building an app that stores domains in database and based on domain it filters data from database and need to show different templates on different sites. This is pretty much universally deserved feature for this kind of use case.
But I could not find how to use different templates for different domains. If I have MyAppWeb.PageLive
module I have to use page_live.html.leex
. That’s not very cool. Because I went to render different template like other_sute.html.leex
but now I’m not able to. Changing layout is not what I want right now. At least I don’t think it’s a good idea.
To change layout based on URI/domain I need to use live_render/3
from ordinary controller. Unfortunately I’m not able to get URI in mount/3
. So it would be a littler cumbersome to convince Phoenix to use different layout based on URI. But I’m open for suggestions.