Data attributes on cards #15832
Unanswered
olemartintwoday
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Was making some simple custom functionality using js in the CP and I'm used to getting data attributes from the blocks, but in Craft CMS 5 these fields are not present. I could switch View mode to "As inline-editable blocks" and it will look like this:
<div class="matrixblock" data-id="123" data-uid="*removed*" data-type="simpleEntry" data-type-name="Simple entry" data-type-id="29" data-field-layout-id="321" data-visible-layout-elements="*removed*" data-base-input-name="*removed*" role="listitem">
When using View mode "As cards", this is how it looks:
<div id="*removed*" class="element removable card" data-type="craft\elements\Entry" data-id="123" data-site-id="1" data-status="live" data-label="label" data-cp-url="*removed*" data-editable="" data-savable="" data-duplicatable="" data-deletable="" data-settings="*removed*">
Getting the "data-type" would be super useful
Beta Was this translation helpful? Give feedback.
All reactions