CMS Development

MaximSiebert
Membre | Partenaire solutions
Membre | Partenaire solutions

Print field within href="" without <div>

Résolue

Hi there, I created a custom module which contains a text field called 'url' I'd like to print this field within an `href` but hubspot's <div> gets printed inside breaking the html.

My markup looks like 

<a class="mt-auto" href="{% inline_text field="url" value="{{ item.url }}" %}" target="_blank">Read More</a>

 

How can I achieve this?

0 Votes
1 Solution acceptée
Stephanie-OG
Solution
Conseiller clé

Print field within href="" without <div>

Résolue

Hi Maxim, 

 

You might find this thread helpful, it recommends using text instead of inline-text. 

 

However, if you're working within a custom module I'd recommend using the "Fields" option on the left-hand side to insert fields:

 

text-field.png

 

In this case, using {{ module.text_field }} or {{ item.text_field }} in a repeater (in this case I've left the default name "text field") should just print the text with no additional markup.

 

I hope that helps!

 


Stephanie O'Gay Garcia

HubSpot Design / Development

Website | Contact

 

If this helped, please mark it as the solution to your question, thanks!

Voir la solution dans l'envoi d'origine

2 Réponses
Stephanie-OG
Solution
Conseiller clé

Print field within href="" without <div>

Résolue

Hi Maxim, 

 

You might find this thread helpful, it recommends using text instead of inline-text. 

 

However, if you're working within a custom module I'd recommend using the "Fields" option on the left-hand side to insert fields:

 

text-field.png

 

In this case, using {{ module.text_field }} or {{ item.text_field }} in a repeater (in this case I've left the default name "text field") should just print the text with no additional markup.

 

I hope that helps!

 


Stephanie O'Gay Garcia

HubSpot Design / Development

Website | Contact

 

If this helped, please mark it as the solution to your question, thanks!

MaximSiebert
Membre | Partenaire solutions
Membre | Partenaire solutions

Print field within href="" without <div>

Résolue

Amazing, that worked! Thanks @Stephanie-OG 

0 Votes