CMS Development

chrisbeyeler
Member

Show custom hubL Variables from blogpost on blog index

Hello out there, it's the first time i request some help with hubspot and i'm not if this is the correct place but i will give a try and hope to get some answers.I'm no coder and no designer, but i have fun with it

 

I added some custom hubL Variables on blogposts:

  • dot_date_start
  • dot_date_end
  • dot_event_location_adress
  • dot_event_price

On the blogpost i am abe to show them with: module.(...)

 

How can i show them in the index page?

 

0 Upvotes
3 Replies 3
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show custom hubL Variables from blogpost on blog index

Heya @chrisbeyeler 

 

You should be able access those variables within your contents loop on the listing page using a little piece of code like this:

{{ content.widgets.your_variable.body.value }}


Alyssa Wilie
Web Developer

LyntonWeb

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
chrisbeyeler
Member

Show custom hubL Variables from blogpost on blog index

Hi @alyssamwilie 

 

Thank you for your very fast answer! I appriciate this!

 

I tried this but i think i have a problem because of the rows. I now used the following code but only absolute_url is working:

 

<div class="event_info">
  <p>
    <b class="bold_label">Start: </b><span>{{ row[0].dot_date_start|datetimeformat('%a., %d. %B %Y %H:%M') }}</span><br />
    <b class="bold_label">Ende: </b><span>{{ row[0].dot_date_end|datetimeformat('%a., %d. %B %Y %H:%M') }}</span>
  </p>
  <p>
    <b class="bold_label">Ort: </b><span>b {{ row[0].dot_event_price }} a</span>
  </p>
  <p>
    <b class="bold_label">Kosten: </b> <span>CHF {{ content.widgets.dot_event_price.body.value }}</span>
  </p>
  
</div>
<div class="event_cta tc ">
  <a href="{{ row[0].absolute_url }}" class="cta_button button color-1 small">Details</a>
</div>
0 Upvotes
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show custom hubL Variables from blogpost on blog index

What are the rows for? Can you show me the full content loop?

Hmm. For custom module values maybe try: 

{{ content.widgets.module_[id number].body.[field name] }}

ex: {{ content.widgets.module_151618187561037.body.dot_date_start }}

You can find the module_[id number] in the Usage snippet at the bottom of the module sidebar.

 

If that doesn't work you may need to switch to default Hubspot fields (text, rich text, etc) instead of using custom modules as pulling those values into a blog listing can be a little wonky.

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.