<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="299795" data-post-id="299795">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hashtemptable" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hashtemptable/120/38387_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hashtemptable
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In my experience this does not work. It returns something like:</p>
<p>** (ArgumentError) :layout expects a tuple of the form {MyLayoutView, :my_template} or false, got: “pos.html”<br>
(phoenix_live_view 0.19.5) lib/phoenix_live_view/utils.ex:216: Phoenix.LiveView.Utils.normalize_layout/2<br>
(phoenix_live_view 0.19.5) lib/phoenix_live_view/router.ex:276: anonymous fn/3 in Phoenix.LiveView.Router.validate_live_session_opts/3<br>
(elixir 1.15.2) lib/enum.ex:2510: Enum.“-reduce/3-lists^foldl/2-0-”/3<br>
(phoenix_live_view 0.19.5) lib/phoenix_live_view/router.ex:240: Phoenix.LiveView.Router.<strong>live_session</strong>/3<br>
lib/selfpos_web/router.ex:82: (module)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299795" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-299795" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299795"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="299796" data-post-id="299796">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The new format requires – as stated – <code>{module, atom}</code> format not <code>{module, string}</code> or just <code>string</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299796" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-299796" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299796"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="299817" data-post-id="299817">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hashtemptable" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hashtemptable/120/38387_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hashtemptable
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>thank you, I am struggling to find where in the docs it defines what should be in the tuple. Sticking to the overrides for now. Maybe if I continue learning the platform I will figure it out someday.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299817" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-299817" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299817"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="322361" data-post-id="322361">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bo_dev" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bo_dev/120/33875_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bo_dev
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you, exactly what I was looking for!</p>
<p>Although I did the opposite of your admin and used a guest layout instead. Guest layout is used for all routes that require a user to be un-authenticated, such as login, register, reset password etc.</p>
<p>Coming from a Laravel background, it made more sense to me in my head <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="322361" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-322361" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="322361"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="341798" data-post-id="341798">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m still sporadically getting pinged on this issue so I wanted to note that I regret <a href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/4" rel="nofollow">my answer</a> and I do NOT recommend doing this.  <a href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/7" rel="nofollow">@LostKobrakai’s post</a> is the right way and should be the accepted answer.  AFAIC it’s objectively better to use what the framework provides over writing custom macros.</p>
<p>I recently inherited a codebase that uses this pattern.  As is almost guaranteed to happen when blazing your own trails additional concerns like authn ended up in these macros which should have been in <code>on_mount</code> callbacks.  This was not only really confusing to figure out at first but the inclusion of the extra logic within macros caused unnecessary compile time dependencies.</p>
<p>Return <code>{:ok, socket, layout: {MyAppWeb.Layouts, :layout}</code> from <code>mount/3</code> or use <code>live_session, :my_session, layout: {MyAppWeb.Layouts, :layout}</code> in the router.</p>
<hr>
<ul>
<li><a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#c:mount/3" rel="noopener nofollow ugc"><code>mount/3</code></a></li>
<li><a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.Router.html#live_session/3" rel="noopener nofollow ugc"><code>live_session/3</code></a></li>
<li><a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#on_mount/1" rel="noopener nofollow ugc"><code>on_mount/1</code></a></li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="341798" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-341798" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="341798"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="356576" data-post-id="356576">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sergio" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sergio/120/26966_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sergio
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here’s how you do it for many live views, by using <code>live_session</code>.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">scope "/", MyAppWeb, host: "dietitian." do
  pipe_through [:browser]

  live_session :dietitian_dashboard, layout: {MyAppWeb.Layouts, :dietitian} do
    live "/", Dietitian.DashboardLive
  end
end
</code></pre>
<p>Make sure you have the file in:</p>
<p><code>lib/my_app_web/components/layouts/dietitian.html.heex</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356576" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-356576" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356576"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="356592" data-post-id="356592">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is also totally valid and actually what I do more often.</p>
<p>Also, I’m still getting likes on my <a href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/4" rel="nofollow">initial answer</a> and wish I can delete it <img src="https://forum.elixirforum.com/images/emoji/apple/frowning.png?v=15" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356592" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-multiple-layouts/57905/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-356592" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356592"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>