<?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 Re: Display a featured image as a background image in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7404#M765</link>
    <description>&lt;P&gt;Some progress! Have gotten the image URL to show up when looking at the source in dev tools, but it's not displaying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if feature_item.post_list_summary_featured_image %}				
&amp;lt;span style='background: url("{{ feature_item.post_list_summary_featured_image }}") center center no-repeat; background-size: cover;' class="hs-featured-image featured-post-image-1"&amp;gt;					
&amp;lt;/span&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 01:11:04 GMT</pubDate>
    <dc:creator>dbarbara</dc:creator>
    <dc:date>2017-02-15T01:11:04Z</dc:date>
    <item>
      <title>Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7402#M764</link>
      <description>&lt;P&gt;Am trying to get a featured image to show as a background image, and need to figure out the HubL to call a featured image from inside some HTML.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3688"&gt;@Jsum&lt;/a&gt;&amp;nbsp;for part of the answer &lt;A href="https://community.hubspot.com/t5/COS-Design-Support/Is-there-a-way-to-allow-content-creator-to-alter-background/m-p/6037" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far, but not sure how to write &amp;nbsp;'background: url ' &amp;nbsp;so it calls the image.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% for feature_item in featured_topic %}

{% image_src "image_src" %}

&amp;lt;div class="featured-post"&amp;gt;
&amp;lt;div class="span6"&amp;gt; 

{% if feature_item.post_list_summary_featured_image %}

&amp;lt;span style='background: url ( {% image_src "{{ feature_item.post_list_summary_featured_image }}" %} ) center center no-repeat; background-size: cover;' class="hs-featured-image featured-post-image-1"&amp;gt;

&amp;lt;/span&amp;gt;
{% endif %}
&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 00:44:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7402#M764</guid>
      <dc:creator>dbarbara</dc:creator>
      <dc:date>2017-02-15T00:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7404#M765</link>
      <description>&lt;P&gt;Some progress! Have gotten the image URL to show up when looking at the source in dev tools, but it's not displaying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if feature_item.post_list_summary_featured_image %}				
&amp;lt;span style='background: url("{{ feature_item.post_list_summary_featured_image }}") center center no-repeat; background-size: cover;' class="hs-featured-image featured-post-image-1"&amp;gt;					
&amp;lt;/span&amp;gt;
{% endif %}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 01:11:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7404#M765</guid>
      <dc:creator>dbarbara</dc:creator>
      <dc:date>2017-02-15T01:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7406#M766</link>
      <description>&lt;P&gt;You are using a span tag which is an inline element (like text). It can't be styled like block elements. Do you have "display: block;" assigned to the span tag in your css? if not you can try that or use a div element instead of a span tag which is probably better syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, regardless of element used, a height and a width need to be set other wise nothing is keeping it from being 0x0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hopefully ones of these helps. Also quotations within the url value of the background attribute are not required. Using them shouldn't have anything to do with your issue, and your code doesn't appear to have any errors. The below just has the quotation marks adjusted.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if feature_item.post_list_summary_featured_image %}				
&amp;lt;span style="background: url({{ feature_item.post_list_summary_featured_image }}) center center no-repeat; background-size: cover;"class="hs-featured-image featured-post-image-1"&amp;gt;					
&amp;lt;/span&amp;gt;
{% endif %}&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 03:06:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7406#M766</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2017-02-15T03:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7457#M774</link>
      <description>&lt;P&gt;Thanks for the input on the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did realize that the image wasn't displaying because&amp;nbsp;there was no content inside &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt; &amp;nbsp;When I added "display: block" as well as a min-height and "width: 100%" everything worked fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's built&amp;nbsp;now is a nice card layout with an image on the left that adjusts based on the viewport width (vs. just reducing both width and height). It can be seen&amp;nbsp;here:&amp;nbsp;&lt;A href="http://cloudburst.astadia.com/blog" target="_blank"&gt;http://cloudburst.astadia.com/blog&lt;/A&gt;&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>Wed, 15 Feb 2017 17:24:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7457#M774</guid>
      <dc:creator>dbarbara</dc:creator>
      <dc:date>2017-02-15T17:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7458#M775</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1567"&gt;@dbarbara&lt;/a&gt;&amp;nbsp;that looks great!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 17:27:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/7458#M775</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2017-02-15T17:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/35769#M3461</link>
      <description>&lt;P&gt;I want to use the&amp;nbsp;featured image of my latest posts for as the background for a hero banner for my blog. I put a hubl module over the listing template.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="HubL Module" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/6122iD10CB0AEE20A9EC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-10-31 at 6.42.20 PM.png" alt="HubL Module" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;HubL Module&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I'm trying to use the following code within that module to display the featured image from the lastest post.&lt;/P&gt;&lt;PRE&gt;{% for post in posts %}
    {% if loop.index = 1 %}
    
        &amp;lt;div class=blog-hero style="background:url('{{ content.featured_image }}') top center no-repeat; background-size: cover;"&amp;gt;&amp;lt;/div&amp;gt;
        
    {% endif %}
{% endfor %}&lt;/PRE&gt;&lt;P&gt;Any idea where I'm going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 17:47:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/35769#M3461</guid>
      <dc:creator>martin3walker</dc:creator>
      <dc:date>2017-10-31T17:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/37003#M3614</link>
      <description>&lt;P&gt;Your looping for post in posts but your targeting content.featured_image. It shouldbe post.featured_image&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 16:17:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/37003#M3614</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2017-11-09T16:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/37422#M3642</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:45:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/37422#M3642</guid>
      <dc:creator>martin3walker</dc:creator>
      <dc:date>2017-11-13T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/346807#M17057</link>
      <description>&lt;P&gt;Can someone post an update on how to do this under the new CMS theme structure?&amp;nbsp; Set feature Image as Blog Post header/banner background image.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 17:52:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/346807#M17057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-14T17:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Display a featured image as a background image</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/346893#M17061</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3688"&gt;@Jsum&lt;/a&gt;&amp;nbsp;would you be able to assist with this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Jess&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 08:08:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Display-a-featured-image-as-a-background-image/m-p/346893#M17061</guid>
      <dc:creator>JessicaH</dc:creator>
      <dc:date>2020-06-15T08:08:10Z</dc:date>
    </item>
  </channel>
</rss>

