title: Blogger template: Style blog post based on label
body: <p>I'm trying to change the style of a blog post (for instance change the title color), based on the labels associated to the post.</p>
  
  <p>I'm a bit new to the templating, so I though I would be going to add a class with the label in the title <code>&lt;h3&gt;</code> element, and then add my CSS rules.</p>
  
  <p>So I found this which would generate a proper list of labels separated by a space:</p>
  
  <pre><code>&lt;b:loop values='data:post.labels' var='label'&gt;&lt;data:label.name/&gt; &lt;/b:loop&gt;
  </code></pre>
  
  <p>However, it seems the validator does not let me add this inside the class attribute as follow:</p>
  
  <pre><code>&lt;h3 class='post-title entry-title &lt;b:loop values="data:post.labels" var="label"&gt;&lt;data:label.name/&gt; &lt;/b:loop&gt;'&gt;
  </code></pre>
  
  <p>From there, I found half the solution. Apparently, I should use expr:class instead of class as follow:</p>
  
  <pre><code>&lt;h3 expr:class='&amp;quot;post-title entry-title &amp;quot; + data:list_of_labels'&gt;
  </code></pre>
  
  <p>So now:
  <br/> - How can I build this variable data:list_of_labels? (basically how to set a variable)
  <br/> - Is there a full description of the template syntax somewhere?
  <br/> - Is there another way to go around this?</p>
  
  <p>Thanks,
  JB</p>