- Posts: 54
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Lightbox popup extra field doesn't work on itemlist view
Lightbox popup extra field doesn't work on itemlist view
- MGS Creativa
- Topic Author
- Offline
- Senior Member
Less
More
6 years 10 months ago - 6 years 10 months ago #166060
by MGS Creativa
Lightbox popup extra field doesn't work on itemlist view was created by MGS Creativa
Hi! In my site I have a K2 category tahts is displayed in the frontend as an itemlist that shows article title and extra fields for each article and no more data.
One of those extra fields is an lightbox popup link field, which didn't worked as expected, the link opens but no lightbox at all, it opens as a normal link.
After some digging, I realized thet the logic that enables JS for the lightbox popups doen't take into account the itemlist view, so in the file administrator/components/com_k2/helpers/html.php on line 236 i have changed thisto this
The change is to add another logical condition to enable JS necessary for the lightbox popup "($option == 'com_k2' && $view == 'itemlist')"
Hope this hits K2 source code.
Thanks!
One of those extra fields is an lightbox popup link field, which didn't worked as expected, the link opens but no lightbox at all, it opens as a normal link.
After some digging, I realized thet the logic that enables JS for the lightbox popups doen't take into account the itemlist view, so in the file administrator/components/com_k2/helpers/html.php on line 236 i have changed this
if (!$user->guest || ($option == 'com_k2' && $view == 'item') || defined('K2_JOOMLA_MODAL_REQUIRED')){
if (!$user->guest || ($option == 'com_k2' && $view == 'item') || ($option == 'com_k2' && $view == 'itemlist') || defined('K2_JOOMLA_MODAL_REQUIRED')){
The change is to add another logical condition to enable JS necessary for the lightbox popup "($option == 'com_k2' && $view == 'itemlist')"
Hope this hits K2 source code.
Thanks!
Last edit: 6 years 10 months ago by MGS Creativa.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 10 months ago #166068
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Lightbox popup extra field doesn't work on itemlist view
Thanks!! I really appreciate this :)
You can also create a PR github.com/getk2/k2 in our repo so your edits are included in the upcoming version.
You can also create a PR github.com/getk2/k2 in our repo so your edits are included in the upcoming version.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- MGS Creativa
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
6 years 10 months ago #166071
by MGS Creativa
Replied by MGS Creativa on topic Lightbox popup extra field doesn't work on itemlist view
PR on his way!
Please Log in or Create an account to join the conversation.
- MGS Creativa
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
6 years 10 months ago #166072
by MGS Creativa
Replied by MGS Creativa on topic Lightbox popup extra field doesn't work on itemlist view
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Lightbox popup extra field doesn't work on itemlist view