- Posts: 21
COMMUNITY FORUM
K2 and joostrap "modals" conflict
- Sandra Currey
-
Topic Author
- Offline
- Junior Member
- Namaste
Less
More
10 years 4 months ago #135286
by Sandra Currey
K2 and joostrap "modals" conflict was created by Sandra Currey
Not sure if anyone else has come across this, but I have a site where I want multiple people around the world to do K2 item editing, as well as allowing item authors to edit their own items. I have a Joostrap template and there is an apparent conflict as both use the command "modals" for different things. This means that with this template applied, K2 edit button on the front-end does not show.
Anyone have a solution / suggestion??
Anyone have a solution / suggestion??
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
10 years 4 months ago #135307
by Lefteris
Replied by Lefteris on topic K2 and joostrap "modals" conflict
Hi. You need to modify the code of either your template or K2. I suggest to ask also your template provider. All the major template providers support K2 so they might also have a workaround.
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135330
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
Hi Sandra,
Max from Joostrap here ... we had a recent post about this and it is something we are unable to resolve with our template - it is K2 conflicting directly with Boostrap core classes. It is not a conflict between Joostrap and K2 ... it is a conflict between BOOTSTRAP and K2.
In Bootstrap, modal is a reserved word .... for a modal popup / lightbox type effect ... and is used on the modal window by Bootstrap.
Joostrap has absolutely no overrides of K2 output/content, so there is nothing on our side that we have done ... except use Bootstrap of course ;)
As this seems to be a relatively new issue, there must have been a recent update to the K2 layout templates that is causing the issue ... either that or an update to Bootstrap - either way ... the K2 layout/template is the bit that needs to be updated to stop this conflict - unless the developers of K2 can somehow get the creators and maintainers of Boostrap to change their code to suit K2 (a lot less likely).
Hope this helps shed some light on the issue ;)
Max from Joostrap here ... we had a recent post about this and it is something we are unable to resolve with our template - it is K2 conflicting directly with Boostrap core classes. It is not a conflict between Joostrap and K2 ... it is a conflict between BOOTSTRAP and K2.
In Bootstrap, modal is a reserved word .... for a modal popup / lightbox type effect ... and is used on the modal window by Bootstrap.
Joostrap has absolutely no overrides of K2 output/content, so there is nothing on our side that we have done ... except use Bootstrap of course ;)
As this seems to be a relatively new issue, there must have been a recent update to the K2 layout templates that is causing the issue ... either that or an update to Bootstrap - either way ... the K2 layout/template is the bit that needs to be updated to stop this conflict - unless the developers of K2 can somehow get the creators and maintainers of Boostrap to change their code to suit K2 (a lot less likely).
Hope this helps shed some light on the issue ;)
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
10 years 4 months ago #135344
by Lefteris
Replied by Lefteris on topic K2 and joostrap "modals" conflict
@Max Lynam
We are aware of this conflict. However when K2 was written, the class "modal" was used everywhere even by core extensions.
We have already used a different class name for the upcoming version 3 of K2.
Regarding the current version of K2 changing the class name will fix the issue for templates like yours but will break the modals for all existing sites that are using overrides for K2. So we need to think again about this. Any suggestions/solutions are welcome.
@Sandra Currey
To get your site working with this template, edit file /plugins/system/k2/k2.php and modify line 47 so it looks like:Then create overrides for all K2 template files and find all links with class "modal" . Change the class name to "k2Modal" and it should work.
You need to write down the change on the system plugin and apply it after every update in K2 v2.x series.
We are aware of this conflict. However when K2 was written, the class "modal" was used everywhere even by core extensions.
We have already used a different class name for the upcoming version 3 of K2.
Regarding the current version of K2 changing the class name will fix the issue for templates like yours but will break the modals for all existing sites that are using overrides for K2. So we need to think again about this. Any suggestions/solutions are welcome.
@Sandra Currey
To get your site working with this template, edit file /plugins/system/k2/k2.php and modify line 47 so it looks like:
JHtml::_('behavior.modal', 'a.k2Modal');
You need to write down the change on the system plugin and apply it after every update in K2 v2.x series.
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135349
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
That's good news about the extension specific naming ... that's definitely the way things should be done :)
-->> 'a.k2Modal' is definitely the best style of naming to use for all of this type of thing.
Glad to see it is known issue and the fix is "on the way".
Thanks for reply, Max.
-->> 'a.k2Modal' is definitely the best style of naming to use for all of this type of thing.
Glad to see it is known issue and the fix is "on the way".
Thanks for reply, Max.
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135352
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
@Lefteris
you could do something like an extensions specific find and replace, with something like NoNumbers Rereplacer ... so specific ONLY to K2 output / wrapper .. find .modal and replace with .k2modal.
..... so that only updates the class and not the rest of the function files, etc ... so there is still that problem ... where you would have to have switchable functionality in the extension to support (most Joomla templates that are using bootstrap) - headache !!!
in the end ... only having consistent naming of functions (like k2modal) will save extensions, like k2, form having conflicts with other extensions, development frameworks, etc ... so the cleanest and best option is having the good naming standards that identify extension functions with the extension they relate to.
sorry for not having a better and easier solution :(
you could do something like an extensions specific find and replace, with something like NoNumbers Rereplacer ... so specific ONLY to K2 output / wrapper .. find .modal and replace with .k2modal.
..... so that only updates the class and not the rest of the function files, etc ... so there is still that problem ... where you would have to have switchable functionality in the extension to support (most Joomla templates that are using bootstrap) - headache !!!
in the end ... only having consistent naming of functions (like k2modal) will save extensions, like k2, form having conflicts with other extensions, development frameworks, etc ... so the cleanest and best option is having the good naming standards that identify extension functions with the extension they relate to.
sorry for not having a better and easier solution :(
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135368
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
FYI: one our our lovely members at joostrap.com, Ric Raftis, kindly posted his solution.
He added:
to his custom.css and it seems to have solved the issue for him ;)
He added:
.modal {
display:block;
}
to his custom.css and it seems to have solved the issue for him ;)
Please Log in or Create an account to join the conversation.
- Sandra Currey
-
Topic Author
- Offline
- Junior Member
- Namaste
Less
More
- Posts: 21
10 years 4 months ago #135376
by Sandra Currey
Replied by Sandra Currey on topic K2 and joostrap "modals" conflict
Thanks Max, I tried the custom.css mod but it created a raft of unpredictable behavior, mainly having a K2 modal for moderation of comments on owned items upon any mouse click... and an interesting combination of semi-site/semi-admin rendering. Quite exciting really.
Will go with modifying the K2 templates, I have NoNumber Rereplacer. Thanks everyone.
Will go with modifying the K2 templates, I have NoNumber Rereplacer. Thanks everyone.
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135377
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
or perhaps the k2 modals are always within a k2 content div, id or class ???
so maybe #kswrapper or .k2-mod or something ... that you could put in front of the .modla ... so:
#kswrapper .modal ???? and then would only effect the ks modals ???
not sure ... but thought I'd mention it.
so maybe #kswrapper or .k2-mod or something ... that you could put in front of the .modla ... so:
#kswrapper .modal ???? and then would only effect the ks modals ???
not sure ... but thought I'd mention it.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
10 years 4 months ago #135394
by Lefteris
Replied by Lefteris on topic K2 and joostrap "modals" conflict
@Max Lynam
There is a container div in all K2 pages, but again this might have changed with an override. Anyway, thanks for your suggestions and your feedback, we will look into it.
There is a container div in all K2 pages, but again this might have changed with an override. Anyway, thanks for your suggestions and your feedback, we will look into it.
Please Log in or Create an account to join the conversation.
- Max Lynam
-
- Offline
- New Member
Less
More
- Posts: 7
10 years 4 months ago #135395
by Max Lynam
Replied by Max Lynam on topic K2 and joostrap "modals" conflict
like I said above -->> Joostrap has NO overrides for K2 ... it is all K2 output.
so ... if everything output by K2 is within a K2 class/ID div ... then the control of the modals with the above suggestions may very well work.
so ... if everything output by K2 is within a K2 class/ID div ... then the control of the modals with the above suggestions may very well work.
Please Log in or Create an account to join the conversation.