CMS Development

KeremKandirali
Participant

Hide/disable a subfield in "alignment" field (custom module)

SOLVE

Hi guys,

 

In a custom module, what should I do to hide/disable the CENTER option for the "type": "alignment" field in fields.json file?

 

alignment.png


Meaning I'd like to see the LEFT and RIGHT option only.

 

I looked around for a hidden subfield but couldn't find any. I assume it should be something like that:

 

{
  "label": "Position Image",
  "name": "img_position",
  "type": "alignment",
  "alignment_direction": "HORIZONTAL",
  "visibility": {
    "hidden_subfields": {
      "???": true
    }
  },
  "default": { "horizontal_align": "LEFT" }
}

 

Any ideas?

0 Upvotes
1 Accepted solution
Oezcan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hide/disable a subfield in "alignment" field (custom module)

SOLVE

Hi @KeremKandirali ,

 

I'm not sure if this works the way you want it to, but I have an alternative for you here.

 

Try it here as in the example:

 

Oezcan_0-1636127254718.png

 

Left:

Oezcan_1-1636127278135.png

 

Right:

Oezcan_2-1636127319750.png

 

Best regards

 

Özcan

 

 

Oezcan Eser Signature

View solution in original post

3 Replies 3
Oezcan
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hide/disable a subfield in "alignment" field (custom module)

SOLVE

Hey @KeremKandirali ,

I thought about your problem again and look if the middle button could be hidden somehow. But I couldn't find a solution, even addressing the classes didn't help. But I think it would be a good idea to write that down here as an idea.

Best regards
Özcan

Oezcan Eser Signature
KeremKandirali
Participant

Hide/disable a subfield in "alignment" field (custom module)

SOLVE

Thank you very much Özcan, yeah, it seems the only solution is using a choice field.

Oezcan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hide/disable a subfield in "alignment" field (custom module)

SOLVE

Hi @KeremKandirali ,

 

I'm not sure if this works the way you want it to, but I have an alternative for you here.

 

Try it here as in the example:

 

Oezcan_0-1636127254718.png

 

Left:

Oezcan_1-1636127278135.png

 

Right:

Oezcan_2-1636127319750.png

 

Best regards

 

Özcan

 

 

Oezcan Eser Signature