Hey Hubspotters,
I’m designing a post listening module for use on a pillar page, similar to the way HubSpot’s pillar pages are built, but I’m not able to get the featured image to feed in. Also, any idea how to make it pull from a blog tag instead of having the entry be manual?
Here’s my snippet: (I’ve used this before with no issues)
<div class="script">
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url: '{{ widget.enter_url_for_first_pinned_post }}',
dataType: 'html',
success: function(post) {
$('.pinnedOneTitle').html($(post).find('#hs_cos_wrapper_name').html());
$('.pinnedOneDate').html($(post).find('.publishedDate').html());
$('.pinnedOneFeatImage').html($(post).find('.post-featured-image').html());
},
complete: function(){
console.log("Pinned Post One Loaded.");
}
});
$.ajax({
url: '{{ widget.enter_url_for_second_pinned_post }}',
dataType: 'html',
success: function(post) {
$('.pinnedTwoTitle').html($(post).find('#hs_cos_wrapper_name').html());
$('.pinnedTwoDate').html($(post).find('.publishedDate').html());
$('.pinnedTwoFeatImage').html($(post).find('.post-featured-image').html());
},
complete: function(){
console.log("Pinned Post Two Loaded.");
}
});
$.ajax({
url: '{{ widget.enter_url_for_third_pinned_post }}',
dataType: 'html',
success: function(post) {
$('.pinnedThreeTitle').html($(post).find('#hs_cos_wrapper_name').html());
$('.pinnedThreeDate').html($(post).find('.publishedDate').html());
$('.pinnedThreeFeatImage').html($(post).find('.post-featured-image').html());
},
complete: function(){
console.log("Pinned Post Three Loaded.");
}
});
});
</script>
</div>
<div class="featured-posts">
<h3 style="letter-spacing: 1px;text-align:center;">You Might Be Interested In . . .</h3>
<hr>
<div class="media-pinned">
<div style="width: 90%; margin: 0 auto;">
<div class="bd">
<div class="img pinnedOneFeatImage"></div>
<span class="date pinnedOneDate"> </span>
<div class="post-header"><h3><a class="pinnedOneTitle" href="{{ widget.enter_url_for_first_pinned_post }}"> </a></h3></div>
</div>
<div class="bd">
<div class="img pinnedTwoFeatImage"> </div>
<span class="date pinnedTwoDate"> </span>
<div class="post-header"><h3><a class="pinnedTwoTitle" href="{{ widget.enter_url_for_second_pinned_post }}"> </a></h3></div>
</div>
<div class="bd">
<div class="img pinnedThreeFeatImage"> </div>
<span class="date pinnedThreeDate"> </span>
<div class="post-header"><h3><a class="pinnedThreeTitle" href="{{ widget.enter_url_for_third_pinned_post }}"> </a></h3></div>
</div>
</div>
</div>