Many time we need to add class to image of tt_content element.
Following script will help you for add class to image element or you can set your own style to image.
tt_content.image.20.1.params.cObject = CASE tt_content.image.20.1.params.cObject { key.field = layout default = TEXT default.value = class="YOUR-CLASS-NAME" } OR tt_content.image.20.1.params.cObject = CASE tt_content.image.20.1.params.cObject { key.field = layout default = TEXT default.value = style="display:block;" }
Above script will help for set default class to image.
If we want to set some style to second image and third image then following script will help you more.
tt_content.image.20.1.params.cObject = CASE tt_content.image.20.1.params.cObject { key.field = layout default = TEXT default.value = class="class1" 1 = TEXT 1.value = class="class2" 2 = TEXT 2.value = class="img-responsive" }
It will also help you when we want to add class related with responsive layout.
I hope it will work for you and make your day š
If you have any queries, please do not hesitate to contact me at Jainish Senjaliya