- Issue created by @man-1982
- π¨π¦Canada man-1982
man-1982 β changed the visibility of the branch 3469036-add-support-for to hidden.
- π¨π¦Canada man-1982
man-1982 β changed the visibility of the branch 3469036-add-support-for to active.
- π¨π¦Canada man-1982
As proof of works please consider this gif-video
There is now an option to select another format for the swiper field.
The result of the work is the ability to open a Swiper by clicking on the content teaser, and the swiper will open in a Drupal modal window on the exact slider where the click occurred.
Added cashing base on a tags.
Thank you
- Status changed to Needs review
about 2 months ago 6:17am 21 September 2024 - π¨π¦Canada man-1982
What's been added:
Drupal modal dialog or native HTML5 dialog option
Controller and route for generating the original Swiper - π³π±Netherlands nk_
Thanks again Andrii for your commitment, it is very appreciated. However the code for 1.0.x version was quite outdated so thanks to motivation gained from you and the other folks I went into a sprint mode and completely re-wrote the code, covering this feature, quite extended with possibilities in comparison with your initial idea as well as some other pending issues here. In shortest this is what is new
Dialog feature.
Please see screenshots below.
- There is total 3 new field formatters for Dialog feature:
- Swiper entity Dialog - can popup own entity with selected mode (which again can be swiper but in modal), or referenced entity with its mode selected, or a rendered field or rendered field item (e.g. only field item with delta=0) for both entities, own or referenced.
- Swiper images Dialog - can popup own entity (if the same view mode it'd be swiper in dialog) or just an image with Entity field item selected as Dialog content.
- Swiper markup Dialog - same like images.
- Dialog can be one of 4 Drupal ui dialog types:
- Modal
- Dialog
- Dialog off canvas
- Dialog off canvas top
- 3. There is quite some Dialog options provided, configurable, such as width, height, ui classes etc.
- 4. Tokens implementations. Can be used for dialog title and/or custom link on plain images formatter.
- 5. Pure drupal dialog implementation without additional JS.
Other improvements
- Disabled view modes for entities are not shown anymore on swiper formatter settings.
- All the above is re-done considering latest code standards and php 8.x compatibility. There are few services, interfaces, routes and controller to run dialog callbacks etc.
- Included patches/issues:
- - https://www.drupal.org/project/swiper_formatter/issues/3472606 β¨ Access to Sliders within Theme JS Active
- - https://www.drupal.org/project/swiper_formatter/issues/3464557 β¨ Allow swiper template names as theme suggestions Needs review
- - https://www.drupal.org/project/swiper_formatter/issues/3403505 π Warning: Undefined array key "#theme" in Drupal\swiper_formatter\Plugin\views\style\SwiperFormatterStyle->render() Fixed
- - https://www.drupal.org/project/swiper_formatter/issues/3479245 π JS Warning About Not Enough Slides Active
- - https://www.drupal.org/project/swiper_formatter/issues/3474010 π Coding Standard issues Needs work
For now, this is only 1.0.x dev version, 2.0.x version is yet to come, it shall include these and a few more features developed there in the meantime. Testing and feedbacks are very appreciated and I am thankful in advance! Next week I am going to be occupied a lot with the other things but will keep an eye on this one. hoping to have it confirmed by crowd and packed into next 1.0.x release.
.
.
. - There is total 3 new field formatters for Dialog feature:
- π³π±Netherlands nk_
Merged and pushed into 2.0.x-dev just now, so changing the version here too.
- π¨π¦Canada man-1982
Hi!
New features looks really cool and promises.
going to test lates dev version.
thanks - π³π±Netherlands nk_
@man-1982 Thank you, your initiative and code was crucial to have this moving on. As you are aware, the module was needing some sort of general redo and a new version, for quite some time, so ultimately your code wasn't matching with a new structure which does not make it less appreciated or useful.
Heads up to everyone following - I just pushed a new versions with a couple of relative important fixes. According to config_inspector β there are still some issues with schema, details, but these, so far, do not break anything and shall be fixed before the release.
@bbu23 thanks so much for hopping in here and for the precise work you do with code!
- π·π΄Romania bbu23
@man-1982 Agree with @nk_, thanks for the contribution and involvement!
Please let us know if you find anything in your tests, I'm also in the process of testing/reviewing. - π¨π¦Canada man-1982
@nk_, @bbu23 Thank you for your work
Close this ticked by know.
We need to focus on testing the new module's features.
- π·π΄Romania bbu23
We'll keep the ticket open as it's related functionality is being worked on & reviewed. We will close this when a new release is being made.
- πΊπΈUnited States JCL324 Portland, OR
[OK Drupal.org issue queues, I'll retype this yet again! (always copy what you type here before saving or previewing)]
I too can confirm that the latest 2.0.x-dev works great for the site this is on. It took some time to get the view mode configured correctly since I only wanted to show one image in the pop - see screenshot.
Thanks for all the work here guys!
- π³π±Netherlands nk_
@jcl324 I am sorry, I am not managing to catch up on this one but soonest.
@bbu23 In case you have a chance, we'd just need to test situation where:
There is Swiper images/dialog formatter on the image field that is attached to Taxonomy term entity. That image field shall have both Title and Alt field enabled, some values for it entered on example terms entity testing items.
A bug to confirm - there is no option to select Title or Alt field as a Caption on the formatter settings.
- π·π΄Romania bbu23
@nk_ I'm not quite sure what the test is. I did the following in Drupal 10 (because vanilla Drupal 11 is not ready for this yet):
- I created a taxonomy vocabulary with an image field with ALT and TITLE enabled
- I configured the display to first show "Swiper images", later "Swiper images Dialog"
- I added a two terms with each 2 or more imagesThe behaviour was ok for images on the term page, but for dialog if I closed the dialog and reopened it, it was empty.
Later I added a term reference field to a node.
I tested the following scenarios:
- Term reference -> non-swiper rendering, so showing the swiper from term through node
- Term reference with swiper formatter: here, of course a case that probably should not be used, the slider had two arrows each side, so 4 arrows in total, and the behaviour was mixed.In none of the cases I could not do anything with the title or alt fields.
- πΊπΈUnited States JCL324 Portland, OR
@bbu23, just to help clarify here, when you configure the "Swiper images Dialog", do you actually see the setting for "Caption source field"? for me, this doesn't even display so I can't select any option. You can see this on #24, first screenshot.
- π·π΄Romania bbu23
@jcl324 I skipped that point because that is confirmed by @nk_:
A bug to confirm - there is no option to select Title or Alt field as a Caption on the formatter settings.
But I confirm that I don't see those options either.
- π³π±Netherlands nk_
Ok, so here's the tiny patch that shall do it. Whoever is able - please do test on entities other than Taxonomy term, thanks!
@bbu23 I see you are busy with some code, please include this patch once it is convenient for you, cheers.
- π·π΄Romania bbu23
Thanks @nk_, I applied the patch in dev version.
@jcl324 could you please check again on the latest dev version? Note that there might be newer commits as well, so please make sure to run drush updb when you update to latest dev version. Thanks
- πΊπΈUnited States JCL324 Portland, OR
Thanks guys, both the patch itself worked as well as the latest dev version. Time to wrap this all up in my branch and get it in front of the client to see. Woot!
- π·π΄Romania bbu23
@jcl324 that's great! Thanks for checking and confirming!