CMS Development

mikemidaxo
Membre

Adding ID's to Content Modules

Résolue

Is there a way to add ID's directly onto image modules or rich text modules? I feel like I used to be able to do this, but currently, it seems like I'm only able to add classes.

 

I can "group" an image module and the ID form field becomes available, but that seems like really unnecessary markup for something simple. Any help? Thanks.

0 Votes
1 Solution acceptée
dennisedson
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Adding ID's to Content Modules

Résolue

@mikemidaxo , do you mean an image field within a module?

you can use {{ name }} as an id to a wrapper within the module. 

Each module does have a unique id. 
if you need a unique id for fields within the you could either add a text field to be inputed or you could append the loop.index to a string so it would look like

<img id="img0">
<img id="img1">
<img id="img2">
<img id="img3">

if it was in a repeater

Voir la solution dans l'envoi d'origine

0 Votes
1 Réponse
dennisedson
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Adding ID's to Content Modules

Résolue

@mikemidaxo , do you mean an image field within a module?

you can use {{ name }} as an id to a wrapper within the module. 

Each module does have a unique id. 
if you need a unique id for fields within the you could either add a text field to be inputed or you could append the loop.index to a string so it would look like

<img id="img0">
<img id="img1">
<img id="img2">
<img id="img3">

if it was in a repeater

0 Votes