Keyword

How to override the k2.backend.css ?

More
4 years 9 months ago #174904 by sekme
Hi,
Could anyone help me with next:
I made for my authors possibility to add articles in front end by using K2 menu item edit form. I want to make some changes in item edit form .css (change colors, hide unessesary fields)., but I need this only for front end. I already made K2 template overrides. But edit item form .css is located in different place : /public_html/media/k2/assets/css/k2.backend.css

1. How can I override k2.backend.css?
2. And How to make that override was only for front end form? The thing is, that the front end item form and backend item form uses the same file .css located in : /public_html/media/k2/assets/css/k2.backend.css . I need to have all fields in backend....


Thank you in advance... already digg all web... no luck for this case.

Joomla 3.9.15
K2 v2.10.3

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #174912 by JoomlaWorks
Replied by JoomlaWorks on topic How to override the k2.backend.css ?
Override the file /components/com_k2/templates/default/itemform.php and in there you can inject your own CSS using the Joomla API (see this: docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #174916 by sekme
Replied by sekme on topic How to override the k2.backend.css ?
Thank you so much Fotis! will work on this...
Have a great weekend!

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #174917 by JoomlaWorks
Replied by JoomlaWorks on topic How to override the k2.backend.css ?
You're welcome :)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #174936 by sekme
Replied by sekme on topic How to override the k2.backend.css ?
Hello again :)

I overrided itemform.php (in templates/my-template/html/com_k2/templates/default/) and added some style (display: none) to hide unnecessary fields. All look good. I need a little help with next:

In my site I use hikashop. And in hika is custom.css and because of that I do have unnecessary changes (for tabs) to itemform look in frontend.

According your link (docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page) it should be possible to add StyleSheet in itemform.php . I thought that it could solve my issue as I wish to have in frontend item form look as is in K2 by default.

$document = JFactory::getDocument();
$document->addStyleSheet(JUri::base()."/public_html/templates/my-template/html/com_k2/templates/default/custom-k2backend.css");

My level of knowledge here is small... I added these lines in itemform.php, created custom-k2backend.css ....but no luck..

Could you please help me with this

Thank you in advance.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #174963 by JoomlaWorks
Replied by JoomlaWorks on topic How to override the k2.backend.css ?
My guess is that your path for CSS is wrong and you probably don't need "public_html/" in it.

Your overrides should also be in /templates/my-template/html/com_k2/default/ and NOT in /templates/my-template/html/com_k2/templates/default/.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #175056 by sekme
Replied by sekme on topic How to override the k2.backend.css ?
Thank you so much Fotis! I made changes according your post. Beautiful! It works :)
Now I can override item form css. The tab issue still is - in front end tabs look not good (attached file), but hopefully I will solve this with css. If you would know the quicker solution, I would be grateful.

Regards

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #175058 by JoomlaWorks
Replied by JoomlaWorks on topic How to override the k2.backend.css ?
Some CSS will inevitably be injected from third-party plugins, but it should not be difficult to neutralize the injected rules...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago - 4 years 8 months ago #175064 by sekme
Replied by sekme on topic How to override the k2.backend.css ?
Thank you :) I use K2 for the first time... and I love it !
Last edit: 4 years 8 months ago by sekme.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #175074 by JoomlaWorks
Replied by JoomlaWorks on topic How to override the k2.backend.css ?
Thumbs up :)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum