CMS Development

FvanderKloot
Member

Custom post types in Hubspot

SOLVE

I'm currently working on a website for a company that offers multiple courses, services, ... Each course has a lot of information, so the best practice would be to create a blog template for those detail pages, but If I do that can I create card listings to show on other pages? 

0 Upvotes
1 Accepted solution
Anton
Solution
Thought Leader

Custom post types in Hubspot

SOLVE

Hi @FvanderKloot

you have to put it in an img-tag like

<img src="{{ rec_post.featured_image }}" alt="{{ rec_post.featured_image_alt }}" class="SOME-CLASS"> {# please note that the featured image alt tag is different than a regular image function #}

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

4 Replies 4
Anton
Thought Leader

Custom post types in Hubspot

SOLVE

Hi @FvanderKloot

creating courses with a blog is a great way but could be bound to quite a lot of custom development(listing & post templates, emails, maybe special modules, lists...)

As for your question:
Yes it's possible to display "course cards" on other pages.

One option would be to use the blog_recent_posts function while creating a custom module.

Here's an example of a module with customizable blog(blog function) and amount(number) setting:

{% set rec_posts = blog_recent_posts(module.blog_select, module.amount_of_posts) %}
<div class="recent-courses-wrapper">
{% for rec_post in rec_posts %}
    <div class="post-title">{{ rec_post.name }}</div>
{% endfor %}
</div>

 

A few tips:

  • If you have Content Hub Professional you could think about creating membership pages and create a whole course area with a dedicated login and user area
  • If you have Marketing Enterprise you could think about creating those courses with custom objects so you have the ability to create "CRM-powered" pages

 

If you need support or have further questions - drop me a DM. I'll be happy to talk in detail

 

 

best, 

Anton

Anton Bujanowski Signature
FvanderKloot
Member

Custom post types in Hubspot

SOLVE

Thanks! 

If I try to implement the featured image it just gives the URL. Do you know how to show the actual image?

0 Upvotes
Anton
Solution
Thought Leader

Custom post types in Hubspot

SOLVE

Hi @FvanderKloot

you have to put it in an img-tag like

<img src="{{ rec_post.featured_image }}" alt="{{ rec_post.featured_image_alt }}" class="SOME-CLASS"> {# please note that the featured image alt tag is different than a regular image function #}

 

best, 

Anton

Anton Bujanowski Signature
FvanderKloot
Member

Custom post types in Hubspot

SOLVE

Thank you so much! 

Just one last question. In my blog template there's a module field "content.start_date" and a field "content.location". I want to show that in the listing, but I can't seem to import it. Do you know if it's possible?

0 Upvotes