<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic what does {%-   -%} mean in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769565#M33350</link>
    <description>&lt;P&gt;This is fairly straight forward question. I 've encounterd the folllowing several time I know {% %} is a statement delimiter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what does&amp;nbsp; the following mean&lt;/P&gt;&lt;P&gt;{% -&amp;nbsp; &amp;nbsp; &amp;nbsp;-%}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 10:24:51 GMT</pubDate>
    <dc:creator>simonp</dc:creator>
    <dc:date>2023-03-16T10:24:51Z</dc:date>
    <item>
      <title>what does {%-   -%} mean</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769565#M33350</link>
      <description>&lt;P&gt;This is fairly straight forward question. I 've encounterd the folllowing several time I know {% %} is a statement delimiter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what does&amp;nbsp; the following mean&lt;/P&gt;&lt;P&gt;{% -&amp;nbsp; &amp;nbsp; &amp;nbsp;-%}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 10:24:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769565#M33350</guid>
      <dc:creator>simonp</dc:creator>
      <dc:date>2023-03-16T10:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: what does {%-   -%} mean</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769576#M33352</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/57528"&gt;@simonp&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the "minus" shortens the blank space before/after the statement.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{%- : deletes the blank/space before the statement

-%} : deletes the blank/space after the statement&lt;/LI-CODE&gt;
&lt;P&gt;If you're in a CSS or HTML file, enable the rendered preview and see the difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This info is quite hidden. You can find it in the &lt;A href="https://developers.hubspot.com/docs/cms/hubl/variables-macros-syntax#macros" target="_blank" rel="noopener"&gt;macro documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anton&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 10:42:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769576#M33352</guid>
      <dc:creator>Anton</dc:creator>
      <dc:date>2023-03-16T10:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: what does {%-   -%} mean</title>
      <link>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769579#M33353</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/57528"&gt;@simonp&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;the syntax {%- -%} is also used to control whitespace in the rendered output of HubSpot's templating language, HubL.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Similar to other template engines, {%- -%} tells HubL to strip any whitespace that immediately precedes or follows the enclosed expression, tag or block.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For example, consider the following HubL code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{% for item in items %}
  &amp;lt;li&amp;gt;{{ item }}&amp;lt;/li&amp;gt;
{% endfor %}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will render a list of items, but it will also include whitespace before and after the &lt;CODE&gt;{% for %}&lt;/CODE&gt; and &lt;CODE&gt;{% endfor %}&lt;/CODE&gt; statements, which may result in unwanted line breaks or indentation in the final output.&lt;/P&gt;
&lt;P&gt;To remove this extra whitespace, you can use the &lt;CODE&gt;{%- -%}&lt;/CODE&gt; syntax like this:&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;{%- for item in items -%}
  &amp;lt;li&amp;gt;{{ item }}&amp;lt;/li&amp;gt;
{%- endfor -%}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;This will ensure that there is no whitespace before or after the &lt;/SPAN&gt;&lt;CODE&gt;for&lt;/CODE&gt;&lt;SPAN&gt; loop statement, resulting in a cleaner rendered output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 10:45:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/what-does-mean/m-p/769579#M33353</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2023-03-16T10:45:01Z</dc:date>
    </item>
  </channel>
</rss>

