Wrapping Rich text field around HTML

SOLVE
Highlighted
Occasional Contributor

Hi HubSpot community,

 

Is it possible to wrap a rich text snippet around HTML, something like this:

{% inline_rich_text field="richtext_field" value="{{ module.richtext_field }}" 
<div class="card">
 <div class="card-body">
  <h2>Title</h2>
 </div>
</div>
%}

I want to put anchor link inside the richtext module and wrap it around the card layout.

The layout looks something like this: 
Screenshot 2020-01-17 at 13.52.02.png

The entire card should be clickable. Right now the button works only as a link.

 

Is it even possible or does anyone know any other solution?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Advisor | Platinum Partner

Hi @Kihulane 

 

I think is better you create Single Line Texts to make this code. Look:

 

<div class="card">
  <div class="card-body">
    <h2>{{ module.title_text }}</h2>
    <p>{{ module.description_text }}</p>
here u can add what you want, how CTA SNIPPET for example. </div> </div>


If you want convert all block in link, try change DIV to A and can use Single Line to configure URL to Anchor or link. Look:

 

<a href="{{ module.link_url_text }}" class="card">
  <div class="card-body">
    <h2>{{ module.title_text }}</h2>
    <p>{{ module.description_text }}</p>
    here u can add what you want, how CTA SNIPPET for example.
  </div>
</a>

 

 

Did this post help solve your problem? If so, please mark it as a solution.

Best regards! Smiley Happy

 

 

2 Replies 2
Advisor | Platinum Partner

Hi @Kihulane 

 

I think is better you create Single Line Texts to make this code. Look:

 

<div class="card">
  <div class="card-body">
    <h2>{{ module.title_text }}</h2>
    <p>{{ module.description_text }}</p>
here u can add what you want, how CTA SNIPPET for example. </div> </div>


If you want convert all block in link, try change DIV to A and can use Single Line to configure URL to Anchor or link. Look:

 

<a href="{{ module.link_url_text }}" class="card">
  <div class="card-body">
    <h2>{{ module.title_text }}</h2>
    <p>{{ module.description_text }}</p>
    here u can add what you want, how CTA SNIPPET for example.
  </div>
</a>

 

 

Did this post help solve your problem? If so, please mark it as a solution.

Best regards! Smiley Happy

 

 

Occasional Contributor

Thank you! I wasn't aware that I can use the "module.link" as a href tag inside anchor.