CMS Development

RGrimsley
Contributor

Image Not Displaying From Image Field in HubSpot Module

Hello!

 

I'm currently having trouble with images not displaying when I create image fields in my module. When I try to inspect the image sources, it doesn't load. Please help if you can!

 

Here's my code:

 

module.html:

 

<div class="news-full-wrap">

<div class="news-content-wrapper">
<div class="news-row">
<section class="news-index-wrap">

<div class="news-item">
<div class="column-1">
<div class="news-img-outer-container">
<a href="{{ module.article_link }}" class="news-gallery-image-container">
<div class="news-thumbnail news-img-wrapper">
<img src="{{ module.article_image }}" alt="{{ module.article_name }}">
</div>
</a>
</div>
</div>

<div class="column-2">
<div class="news-summary-content news-meta-container">
<div class="news-summary-title">
<a href="{{ module.article_link }}" class="news-summary-title-link">{{ module.article_name }}
</a>
<div class="author-excerpt summary-author-only">
<p>
{{ module.author_s_ }}
</p>
</div>
<div class="container--below-author">
<div class="author-metadata--primary">
<a href="{{ module.article_link }}" class="news-read-more-button">Read More</a>
</div>
</div>
</div>
</div>
<div class="publisher-container">
Published by:
<div class="publisher-logo">
<img src="{{ module.publisher_logo }}" class="article-publisher">
</div>
</div>
</div>
</div>

</section>
</div>
</div>
</div>

 

module.css:

.news-full-wrap .news-content-wrapper {
padding-bottom: 0px;
}
.news-full-wrap .news-row {
display: flex;
margin-left: -15px;
margin-right: -15px;
}
.news-full-wrap .news-index-wrap {
display: flex;
align-items: center;
flex-wrap: wrap;
min-width: 100%;
}
.news-full-wrap .news-index-wrap:after, .news-full-wrap .news-index-wrap:before {
content: "";
display: block;
clear: both;
}
.news-item {
transition: box-shadow .2s;
float: left;
display: flex;
align-items: center;
margin-bottom: 1%;
position: relative;
width: 100%;
align-items: center;
background: #ffffff;
box-sizing: border-box;
justify-content: space-evenly;
}
.news-full-wrap .news-index-wrap .news-item:hover {
box-shadow: 0 0 13px rgba(33,33,33,.2);
}

.news-full-wrap .news-index-wrap .news-item:hover .news-summary-title {
font-family: roobert-bold;
}

.news-full-wrap .news-index-wrap .news-item:nth-child(3n) {
margin-right: 1%;
}
.news-full-wrap .news-index-wrap .news-item .column-1 {
float: left;
width: 30%;
position: relative;
vertical-align: middle;
align-items: center;
}
.news-full-wrap .news-index-wrap .news-item .column-2 {
float: left;
width: 65%;
position: relative;
vertical-align: middle;
align-items: center;
}
.news-full-wrap .news-img-outer-container {
position: relative;
width: 100%;
}
.news-full-wrap a.news-gallery-image-container {
margin: 15px;
display: block;
width: 90%;
}
.news-full-wrap a.news-gallery-image-container .news-thumbnail.news-img-wrapper {
overflow: hidden;
padding-bottom: 66.6667%;
position: relative;
width: 100%;
height: auto;
}
.news-full-wrap a.news-gallery-image-container .news-thumbnail.news-img-wrapper img {
position: absolute;
font-size: 13px;
line-height: normal;
transition: .6s opacity;
width: 100%;
height: 100%;
object-fit: cover;
}
.news-full-wrap .news-summary-content.news-meta-container {
width: 100%;
vertical-align: middle;
}
.news-full-wrap .news-summary-content.news-meta-container .news-summary-title {
font-size: 32px;
line-height: 1.2em;
text-align: left;
width: 65%;
font-family: roobert-semibold;
margin: 30px;
}
.news-full-wrap .news-summary-content.news-meta-container .news-summary-title a.news-summary-title-link {
color: #1e2d39;
width: 100%;
}
.news-full-wrap .author-excerpt.summary-author-only {
width: 100%;
margin-top: 10px;
margin-bottom: 10px;
}
.news-full-wrap .author-excerpt.summary-author-only p {
font-size: 18px;
font-family: roobert-light;
line-height: 1.4em;
margin: 0;
text-align: left;
padding-right: 10px;
}
.news-full-wrap .container--below-author {
font-size: 13px;
line-height: normal;
}
.news-full-wrap .publisher-container {
font-family: roobert-light;
font-size: 12px;
float: right;
}

@media(max-width: 767px){
.news-full-wrap .news-index-wrap .news-item {
float: left;
margin-bottom: 3.18182%;
margin-right: 0;
min-height: unset;
position: relative;
width: 100%;
}
.news-full-wrap .news-content-wrapper{
padding: 35px 35px;
}
}

@media(max-width: 640px){
.news-full-wrap .news-content-wrapper{
padding: 35px 20px 0;
}
}

.news-read-more-button {
background-color: #426270;
border-radius: 3px;
color: #fff;
font-family: roobert-semibold;
padding: 12px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
float: left;
font-size: 16px;
margin-top: 5px;
margin-bottom: 15px;
margin-right: 15px;
vertical-align: middle;
}

.news-read-more-button:hover {
color: #d9ff00;
}

 

Here's what I'm seeing:

Screenshot 2023-03-08 at 9.55.19 AM.png

0 Upvotes
3 Replies 3
Jaycee_Lewis
Community Manager
Community Manager

Image Not Displaying From Image Field in HubSpot Module

Hi, @RGrimsley 👋 We're you able to make progress here? 

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
RGrimsley
Contributor

Image Not Displaying From Image Field in HubSpot Module

Hey, Jaycee! I was able to figure it out!!

0 Upvotes
Woodsy
Top Contributor

Image Not Displaying From Image Field in HubSpot Module

Hi what did you change to get this to work? Thanks

0 Upvotes