Enabling Images in Blog Slider Module

I’ve been trying to do this on my own for too long :slightly_smiling_face:

I’m using a HubSpot Blog module, and it seems to me that it should be showing the featured image when creating the slider of blogs. There are the titles of the blogs, but no images showing. Module code shows like it should be using them. Any help would be greatly appreciated:


Hubspot Blog Module

What it currently looks like

@DBarber1000 Might be a silly question, but are the featured images turned on in each of those blog posts?

Thank you for your reply, and just checked again and all of them are switched to on.

One of the concerns I shared with the team is that most of the images are 6mb and may not have enough time to load(15 articles and counting)

In that case, would need to see more of the module’s code. The current screenshot does not provide enough context on what could be the issue.

Image size certainly could have an impact on load time, but they would still load eventually.

appreciate you @evaldas

Its the standard Blog Module, code below.

{% if module.blog_settings.type_of_posts == 'recent' %}
 {% set atmc_blog_posts = blog_recent_posts(module.blog_settings.blog, module.blog_settings.number_of_posts) %}
{% elif module.blog_settings.type_of_posts == 'popular' %}
 {% set atmc_blog_posts = blog_popular_posts(module.blog_settings.blog, module.blog_settings.number_of_posts) %}
{% else %}
 {% set atmc_blog_posts = blog_recent_tag_posts(module.blog_settings.blog, [module.blog_settings.tag], module.blog_settings.number_of_posts) %}
{% endif %}

			<div id="{{ module.custom_id }}" class="atmc-blog-01 {% if module.text_white %}text-white{% endif %} text-{{ module.alignment }} {% if module.blog_settings.layout == 'slider' %}{% if module.enable_animation %}sr-invisible {{ module.animation }}{% endif %}{% endif %} {{ name }} {{ module.custom_class }}">
				<div class="atmc-blog-01_repeater {% if module.blog_settings.layout == 'grid' %}atmc-grid atmc-grid-{{ module.blog_settings.items_per_row }}col{% else %}atmc-slider{% endif %}"
						 {% if module.blog_settings.layout == 'slider' %}
							 data-slider-item="{{ module.blog_settings.items_per_row }}" 
							 data-slider-arrows="{% if module.slider_settings.arrows %}true{% else %}false{% endif %}"
							 data-slider-dots="{% if module.slider_settings.dots %}true{% else %}false{% endif %}"
							 data-slider-autoplay="{% if module.slider_settings.autoplay %}true{% else %}false{% endif %}"
 data-slider-featured_image="{% if module.slider_settings.featured_image %}true{% else %}false{% endif %}"
							 data-slider-autoplayspeed="{{ module.slider_settings.autoplay_speed }}"
							 data-slider-infinite="{% if module.slider_settings.infinite %}true{% else %}false{% endif %}"
						 {% endif %}>
					{% for atmc_blog_post in atmc_blog_posts %}
 <div class="atmc-blog-01_img atmc-hover-scaleup" style="background-image:url('{{ atmc_blog_post.featured_image }}');">
						<a class="atmc-blog-01_box atmc-grid-col text-default {% if module.text_white %}text-white{% endif %}" href="{{ atmc_blog_post.absolute_url }}">
							<div class="{% if module.blog_settings.layout != 'slider' %}{% if module.enable_animation %}sr-invisible {{ module.animation }}{% endif %}{% endif %}">
								{% if atmc_blog_post.featured_image %}
								<div class="atmc-blog-01_img_wrapper overflow-hidden shadow-md rounded {{ module.blog_settings.image_ratio }}">
									<div class="atmc-blog-01_img atmc-hover-scaleup" style="background-image:url('{{ atmc_blog_post.featured_image }}');"></div>
									<p class="atmc-blog-01_info bg-primary"><span class="atmc-blog-01_date">{{ atmc_blog_post.publish_date|datetimeformat('%d') }}</span><span class="atmc-blog-01_month">{{ atmc_blog_post.publish_date|datetimeformat('%b') }}</span></p>
								</div>
								{% endif %}
 </div>
						</a>
 </div>
					{% endfor %}
				</div>
			</div> 

@DBarber1000 ran the module’s code through a test and it’s pulling the featured images fine for me, the logic seems alright.

There might be something else going on, possibly some CSS or JavaScript issues. Unable to tell without seeing the full picture.

Could also be that there are multiple versions of this module:

One thing that is odd is that in your screen shot of the front end, the slider is displaying the blog post names. However, in the code you shared, there does not seem to be any references to blog post names, so they should not be showing up at all. This module would show only the featured image and the date of the post based on that code.

Thank you @evaldas, I’ll continue digging into this.

I’ll post back here if I find anything.

Regards,
Dane

thank you @evaldas,

I’ll continue digging into this and replay back with anything I find.

I appreciate your help,

regards,
Dane

Hi @evaldas,

apparently it was inheriting a position:Absolute from somewhere, unchecked and everything was great. Appreciate all your help.

Regards,
Dane

Hi @DBarber1000 - not a problem. Thank you for following up and glad to hear you got this resolved!