Topic: Can I add actions to a LightBox gallery?

Nadia Cerezo free asked 5 years ago


What I want is to give my users access to a gallery of photos they themselves (as a group) have uploaded. And I want admin users to be able to pick some of those pictures as "favorites" so that they will be featured on the home page. Ideally, I would love for a star to appear directly on each picture in the gallery that would work as a status display (filled if the photo is favorite, empty otherwise) and as a toggle button.

Is there anyway to make that work with the pretty neat Lightbox gallery? Or is there a more appropriate way to structure my gallery so that I can customize each picture and what elements are displayed on each "slide"?

...or is my only solution to build my own customized gallery from scratch?


Damian Gemza staff answered 5 years ago


Dear @Nadia Cerezo

I'm afraid, that you have to build your own customized gallery from scratch to fill up your needs.

You can't add your custom elements to the Lightbox component.

What can I advise you? That's not the best workaround, but it may work for you:

Generate dynamically an icon (for example star), and append it to every picture of the lightbox (with Angular Renderer2 and position: absolute).

There's no other way to achieve your desired behavior without creating your custom gallery component.

Best Regards,

Damian



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No