Phoenix Multiple Layouts

Here’s how you do it for many live views, by using live_session.

scope "/", MyAppWeb, host: "dietitian." do
  pipe_through [:browser]

  live_session :dietitian_dashboard, layout: {MyAppWeb.Layouts, :dietitian} do
    live "/", Dietitian.DashboardLive
  end
end

Make sure you have the file in:

lib/my_app_web/components/layouts/dietitian.html.heex