CMS Development

Philip_Marsh
Contributor

Help with blog_recent_author_posts

SOLVE

Hi,

 

I have had this piece of code on our website for some time but only recently I have noticed that it has stopped working fully. I have pasted the full code below with a link to the page it's on (at the bottom "Other Articles by...").

 

Everything seems to work except for the following:

 

  • rec_post.url
  • rec_post.blog_post_author.display_name

I want to return the name of the author, as well as the URL for the blog. I have added |pprint at the end and they just return as null. 

 

This code should pull in the most recent blog posts from the author of the current page. This works fine apart from the URL and the author name. 

 

I've also tried:

  • rec_post.absolute_url
  • rec_post.blog_post_author.name

 

{% set rec_posts = blog_recent_author_posts('default', content.blog_post_author.slug, 4) %}
{% for rec_post in rec_posts %}

<div class="item text-left shadow-on-hover">
<div>
<a class="no-underline" href="{{ rec_post.url }}"><div class="cover-bg lazy" style="background-image: url({{ rec_post.featured_image }}); min-height:200px;"></div></a>
<div class="add-padding">
<p><a class="nothing" href="{{ rec_post.url }}">{{ rec_post.title }}</a></p>

<p><strong>{{ rec_post.blog_post_author.display_name }} | {{ rec_post.publishDate|datetimeformat('%d')}} {{ rec_post.publishDate|datetimeformat('%b')}} {{ rec_post.publishDate|datetimeformat('%Y')}}</strong></p>
<p>{{ rec_post.meta_description}}</p>

</div>
</div>
<div class="add-padding">
<p style="padding:0;"><a href="{{ rec_post.url }}">Read blog post ></a></p>
</div>
</div>

{% endfor %}

 

https://www.cfglaw.co.uk/blog/staying-positive-after-a-brain-injury

0 Upvotes
1 Accepted solution
kamlesh_k
Solution
Member | Diamond Partner
Member | Diamond Partner

Help with blog_recent_author_posts

SOLVE

It was a hubspot side Issue. now it is fixed

View solution in original post

3 Replies 3
kamlesh_k
Solution
Member | Diamond Partner
Member | Diamond Partner

Help with blog_recent_author_posts

SOLVE

It was a hubspot side Issue. now it is fixed

Philip_Marsh
Contributor

Help with blog_recent_author_posts

SOLVE

Thank you

0 Upvotes
sharonlicari
Community Manager
Community Manager

Help with blog_recent_author_posts

SOLVE

Hey @Philip_Marsh       

 

Thank you for the information provided. I'll tag a few experts.  

 

Hey @Kevin-C @SandyG1 @John  what would you advise in this case?    

 

Thanks & Happy Friday!

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes