Hello, Im having issue, having multiple layouts.
- Layouts for Admin (System Access / Portal / Data Management)
- Layouts for Login / Register
I create new plug for router just to handle different layouts for login
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {WebApp.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :fetch_current_user
end
pipeline :login_page do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {WebApp.AuthenticationLayouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :fetch_current_user
end
And I copy the original layouts and make the layouts components as below :
This will make whenever I visit link /users/log_in (Using Original Phx Auth) it will render root file from folder components auth_layouts.
However when I use code <%= @inner_content %> inside root file auth_layouts/root.html.heex it will render page from file layouts/app.html.heex instead of auth_layouts/app.html.heex. Please suggest/assist where can I change to make it render auth_layouts/app.html.heex. Thanks. Any response is highly appreciated
side note : Sorry if the question kinda noob, this is my first project using Phx Framework. Excited but can’t find the solution.























