All item attributes via data-lg-config
Closed this issue · 1 comments
brosland commented
Summary
It would be great to have an option to set all item attributes via json and one data attribute data-lg-config
.
Basic example
Example 1 - link with image thumbnail as a trigger button
<a
href="img.jpg"
data-lg-config="{json}"
data-lg-item="0"
role="button"
>
<img src="img.jpg" alt="">
</a>
Example 2 - link with custom content as a trigger button
<a
href="img.jpg"
class="btn"
data-lg-config="{json}"
data-lg-item="0"
role="button"
>
<i class="fa-light fa-magnifying-glass-plus"></i>
</a>
Example 3 - any html element as a trigger button
<button
class="btn"
data-lg-config="{json}"
data-lg-item="0"
type="button"
>
<i class="fa-light fa-magnifying-glass-plus"></i>
</button>
Motivation
I'm creating an editation of photo gallery, very similar to Google Photos - Album.
I need something like Example 3 and just now I see only one option how to do it, via Dynamic variables.
I think this improvement can be very handy in case like this.
Best regards,
Martin
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.