Adds data-tainacan-item-id attribute to all items on theme view modes.

This commit is contained in:
mateuswetah 2020-11-19 10:30:59 -03:00
parent 9889dddf69
commit 86cceb8d2e
6 changed files with 6 additions and 1 deletions

View File

@ -35,6 +35,7 @@
<a <a
role="listitem" role="listitem"
:key="index" :key="index"
:data-tainacan-item-id="item.id"
v-for="(item, index) of items" v-for="(item, index) of items"
class="tainacan-card" class="tainacan-card"
:href="getItemLink(item.url, index)"> :href="getItemLink(item.url, index)">

View File

@ -34,6 +34,7 @@
class="tainacan-list-container"> class="tainacan-list-container">
<a <a
role="listitem" role="listitem"
:data-tainacan-item-id="item.id"
:href="getItemLink(item.url, index)" :href="getItemLink(item.url, index)"
:key="index" :key="index"
v-for="(item, index) of items" v-for="(item, index) of items"

View File

@ -40,6 +40,7 @@
class="tainacan-masonry-container"> class="tainacan-masonry-container">
<a <a
role="listitem" role="listitem"
:data-tainacan-item-id="item.id"
:key="index" :key="index"
v-for="(item, index) of items" v-for="(item, index) of items"
class="tainacan-masonry-item" class="tainacan-masonry-item"

View File

@ -40,6 +40,7 @@
class="tainacan-records-container"> class="tainacan-records-container">
<a <a
role="listitem" role="listitem"
:data-tainacan-item-id="item.id"
:href="getItemLink(item.url, index)" :href="getItemLink(item.url, index)"
:key="index" :key="index"
v-for="(item, index) of items" v-for="(item, index) of items"

View File

@ -448,7 +448,7 @@ export default {
virtual: { virtual: {
slides: self.slideItems, slides: self.slideItems,
renderSlide(slideItem) { renderSlide(slideItem) {
return `<div role="listitem" class="swiper-slide tainacan-slide-item"> return `<div data-tainacan-item-id="`+ slideItem.id + `" role="listitem" class="swiper-slide tainacan-slide-item">
<img <img
alt="` + (slideItem['thumbnail_alt'] ? slideItem['thumbnail_alt'] : (self.$i18n.get('label_thumbnail') + ': ' + slideItem.title) ) + `" alt="` + (slideItem['thumbnail_alt'] ? slideItem['thumbnail_alt'] : (self.$i18n.get('label_thumbnail') + ': ' + slideItem.title) ) + `"
class="thumbnail" class="thumbnail"

View File

@ -90,6 +90,7 @@
</thead> </thead>
<tbody> <tbody>
<tr <tr
:data-tainacan-item-id="item.id"
:key="index" :key="index"
v-for="(item, index) of items"> v-for="(item, index) of items">