Modals

Alt as description?

2 weeks 5 days ago #77863

Liam Hanks's Avatar Liam Hanks

I'd like to request the option, through the plugin configuration, to use the alt tag of images in a gallery as the modal description, rather than the modal title (as is currently available). This could appear as a third option in the "Use Title Attribute" section as "No / Use as Title / Use as Description" or something like that.
I'm trying to set up a class-triggered modal gallery (ie, not using the inline {modal}{/modal} tags), but some of the images have lengthy descriptions that really don't work well as titles.
Thanks!

2 weeks 5 days ago #77864

Peter van Westen's Avatar Peter van Westen Admin

You can add your own custom title layout by adding a data-modal-title attribute to your <a> tags:

data-modal-title="TITLE<div class=&quot;modals_description&quot;>DESCRIPTION</div>"

Or use the data.txt file as described here:
www.regularlabs.com/extensions/modals/tu...les-and-descriptions

2 weeks 5 days ago #77866

Liam Hanks's Avatar Liam Hanks

I'm not sure how I could add that to the <a> tag, as that tag isn't in my markup, it's generated automatically by the plugin. All I have is class="modal" on the image itself, and auto-convert classnames enabled for images. Example of my HTML:

<img src="images/image.jpg" alt="Description of image" class="modal" />

2 weeks 4 days ago #77880

Peter van Westen's Avatar Peter van Westen Admin

Please try the latest development version from:
www.regularlabs.com/development-releases

You should now have these options in the Modals system plugin settings:



You can now also set the title/description via data-title and data-description attributes. This will override the title/alt attributes if you use them.
<img src="images/image.jpg" alt="Description of image" data-description="Description of image used in modal" class="modal" />

You can also set titles and descriptions via the data.txt file in the folder of the image.

2 weeks 4 days ago #77883

Liam Hanks's Avatar Liam Hanks

Thanks for the updated version, it seems to work perfectly!

One thing I've noticed however is that there is some markup appearing in the hover text on the images. It's not a big deal, but just thought I'd mention it.

2 weeks 4 days ago #77884

Peter van Westen's Avatar Peter van Westen Admin

Please try the latest development version from:
www.regularlabs.com/development-releases

2 weeks 4 days ago #77886

Liam Hanks's Avatar Liam Hanks

Perfect!

I really can't imagine building a Joomla website without using several of your extensions. They (and you... and your support) are truly awesome!

Thanks!

2 weeks 4 days ago #77893

Peter van Westen's Avatar Peter van Westen Admin

:) Thanks!

The new features will be included in the next release.