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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="samgaw" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/samgaw/120/9325_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  samgaw
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Cheers Andy. I’m really starting to question myself now and I don’t know if it’s because I’m being really stupid, or I just suck at explaining what I was trying to achieve. Taking your inline macros, <a href="https://forum.elixirforum.com/t/svgs-eex-tags-inlining-from-external-file/25942" rel="nofollow">much like the ones at the top</a>, I’m still unable to get Phoenix to evaluate EEx tags inside the SVG.</p>
<p>I’ve put a really quick example up <a href="https://github.com/samgaw/dyn_img" rel="noopener nofollow ugc">https://github.com/samgaw/dyn_img</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="160675" 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/svgs-eex-tags-inlining-from-external-file/25942/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-160675" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="160675"
                     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="160683" data-post-id="160683">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m definitely missing something - the inline SVG macros above are designed to be used like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    &lt;button class="btn btn-primary mb2 btn-ple" style='margin-left: 5px' type='submit'&gt;
      #{ Svg.inline("SquareOk") } 
    &lt;/button&gt;
</code></pre>
<p>(from the code AndyL linked)</p>
<p>But if you’ve got EEx markup that needs to be compiled into a function to return the SVG, it seems like <code>render</code> with an <code>.svg.eex</code> partial should do the right thing:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  &lt;div class="place-where-svg-goes"&gt;
    &lt;%= render("my_template.svg", some_param: "foo") %&gt;
  &lt;/div&gt;
</code></pre>
<p>What about the render approach doesn’t work for your use case?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="160683" 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/svgs-eex-tags-inlining-from-external-file/25942/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-160683" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="160683"
                     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="160702" data-post-id="160702">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="samgaw" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/samgaw/120/9325_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  samgaw
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><code>render</code> works fine. It just gets a little unwieldy as the number of components increases and they start getting shared between views.  Which is why I was <a href="https://forum.elixirforum.com/t/svgs-eex-tags-inlining-from-external-file/25942/10" rel="nofollow">saying</a> I’ll maybe get a chance to revisit it at some stage to find a more elegant approach to structuring them in a project e.g. helper macros + a different pattern on <code>use Phoenix.View, root: ""</code>.</p>
<p>Using the inline macros for styling elements genuinely wasn’t a use case I’d consider so it makes now why I was confused with responses here <img src="https://forum.elixirforum.com/images/emoji/apple/crazy_face.png?v=15" title=":crazy_face:" class="emoji" alt=":crazy_face:" 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="160702" 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/svgs-eex-tags-inlining-from-external-file/25942/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-160702" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="160702"
                     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>