Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All item attributes via data-lg-config #1611

Open
brosland opened this issue Mar 23, 2024 · 1 comment
Open

All item attributes via data-lg-config #1611

brosland opened this issue Mar 23, 2024 · 1 comment
Labels

Comments

@brosland
Copy link

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

Copy link

stale bot commented May 25, 2024

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.

@stale stale bot added the v1 label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant