lufi
lufi

Reputation: 670

HTML5 Custom Data Attributes in TYPO3 Backend Content Elements

I am wondering if there is a way to add a HTML5 Custom Data Attribute to any Content Element like Text or Text w/ images.

Anyone tried / did this before or is there a good reason not to do this?

Upvotes: 0

Views: 516

Answers (3)

lufi
lufi

Reputation: 670

Thank's for the answers. I didn't know DCE, looks very interesting.

As I needed a quick solution for just a few elements on one page I did something really quick and dirty. But as it worked for me, I would like to post it in addition to the two other excellent answers.

I used the field Description field to add the content of my custom field. I know it's not intended for this, but as alreay mentioned: quick & dirty. :-)

tt_content.stdWrap.innerWrap.cObject {
    50 =< tt_content.stdWrap.innerWrap.cObject.default
    50.20.10.value = csc-default layout-{field:layout}" data-filter="{field:rowDescription}
    50.20.10.insertData = 1
}

Upvotes: 0

biesior
biesior

Reputation: 55798

... or in addition to @pgampe's answer, which is fine for programmers you can use ie. DCE extension, which allows you to create any HTML structure with usage pure Fluid syntax

Upvotes: 1

pgampe
pgampe

Reputation: 4578

You can either add a new field (own extension) or use any of the existing (e.g. layout to define own values. Then you can change the TypoScript rendering based on the value of this field.

Upvotes: 1

Related Questions