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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m not aware of any library doing this like in Laravel, but it’s easy enough to set it up on your own.</p>
<p>Take a look at <code>render_existing</code>:<br>
<a href="https://hexdocs.pm/phoenix/Phoenix.View.html#render_existing/3" class="onebox" target="_blank" rel="noopener nofollow ugc">https://hexdocs.pm/phoenix/Phoenix.View.html#render_existing/3</a></p>
<p>You would have a bunch of these in your <code>app.html</code>, or wherever you define your top-level layout files:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&lt;%= render_existing @view_module, "page_layout/head_scripts_css.html", assigns %&gt;
&lt;%= render_existing @view_module, "page_layout/head_scripts_js.html", assigns %&gt;
</code></pre>
<p>and then a <code>page_layout</code> folder structure per view template where you would create and place these <code>head_scripts_css.html</code> as needed.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="130617" 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/javascript-in-phoenix-templates/22825/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-130617" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="130617"
                     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="130633" data-post-id="130633">
  <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 big difference between <code>render_existing</code> and what most templating engines allow for is in the possibilities in nesting.</p>
<p>In phoenix you can only use <code>render_existing</code> for view modules you know about. So e.g. the outer layout html is aware of the view_module the controller told it to render (might be selected explicit or implicit). It’s however not aware of arbitrary nested partial templates, which are used somewhere deeper down the call stack of templates rendered within other templates.</p>
<p>So <code>render_existing</code> doesn’t play well when you want a partial to add something to the layout.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="130633" 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/javascript-in-phoenix-templates/22825/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-130633" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="130633"
                     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>