CMS Development

mikemidaxo
Membro

Adding ID's to Content Modules

resolver

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 Avaliação positiva
1 Solução aceita
dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Adding ID's to Content Modules

resolver

@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

Exibir solução no post original

0 Avaliação positiva
1 Resposta 1
dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Adding ID's to Content Modules

resolver

@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 Avaliação positiva