CMS Development

Kihulane
Participante

Wrapping Rich text field around HTML

resolver

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?

0 Avaliação positiva
1 Solução aceita
DanielSanchez
Solução
Conselheiro(a) de destaque | Parceiro Platinum
Conselheiro(a) de destaque | Parceiro Platinum

Wrapping Rich text field around HTML

resolver

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! 🙂

 

 

Exibir solução no post original

2 Respostas 2
DanielSanchez
Solução
Conselheiro(a) de destaque | Parceiro Platinum
Conselheiro(a) de destaque | Parceiro Platinum

Wrapping Rich text field around HTML

resolver

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! 🙂

 

 

Kihulane
Participante

Wrapping Rich text field around HTML

resolver

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