This is possible but it isn’t exactly intuitive. Basically, you need to change the root layout at the plug level, and not the live view level. eg:
pipeline :admin do
plug :set_layout, template: "admin.html"
end
defp set_layout(conn, opts) do
conn |> put_layout(opts[:template])
end
scope "/admin" do
pipe_through [:browser, :admin]
live "/users", SomeliveView
end
scope "/" do
# other things here
end
Basically, when you set the layout within the world of live view, you’re really setting a sort of “sub” layout that runs inside and after the root one set in plug. If you want to change the root entirely because you need to use the @conn then you need to swap that out at the plug level.