Keyword

Where to put css override?

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 8 months ago #102709 by theant
Where to put css override? was created by theant
Hello
I'm a little confused about where exaclty to put the modified css file to override K2 one.
I tried
templates/my-template/html/com_k2/css/k2.css
and
templates/my-template/html/com_k2/css/k2.css

but it doesn't work.

Please, can you help me?

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

More
12 years 8 months ago #102710 by Keith Dick
Replied by Keith Dick on topic Re: Where to put css override?
/templates/my-template/html/com_k2/templates

Then copy the complete default k2 template file including the css file and all the .php files into this 'templates folder so you will now have:
/templates/my-template/html/com_k2/templates/default

Now add copies of the defailt file with all contents into the same folder having renamed it to anything you want:
/templates/my-template/html/com_k2/templates/blog
Now rename the .css file contained within to match the folder name blog_style.css don't forget the _style in the name.

There's a good tutorial here: [url=K2 Override tutorial]getk2.org/documentation/k2class2012/item/865-k2-template-and-overrides[/url]

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

More
12 years 8 months ago #102711 by william white
Replied by william white on topic Re: Where to put css override?
I like to use css4k2 avaliable at k2joom.com
The last movie in the ostraning series under documentation shows how in detail

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

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 8 months ago #102712 by theant
Replied by theant on topic Re: Where to put css override?
Thank you Twoten
I want simple to modify the main css file, not the view files, because if I upgrade K2 I don't overwrite the modified file.
So, I must copy the
components/com_k2/css/
into
templates/my_template/html/com_k2/css/?
It seems don't affect the look of k2 items

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

More
12 years 8 months ago #102713 by Lefteris
Replied by Lefteris on topic Re: Where to put css override?
In order to override the component CSS you need to create the file /templates/YOUR_TEMPLATE/css/k2.css.

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

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
12 years 7 months ago #102714 by theant
Replied by theant on topic Re: Where to put css override?
Thank you Lefteris.

Please, fix the path into your templating tutorial here:
getk2.org/documentation/tutorials/item/174-templating-with-k2-and-the-concepts-of-sub-templates

the right path to use is not
/templates/YOURTEMPLATE/html/com_k2/default/item.php

but
/templates/YOURTEMPLATE/html/com_k2/templates/default/item.php

otherwise it doesn't work (for me)

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

More
11 years 8 months ago - 11 years 8 months ago #102715 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
Sorry to revive an old thread, but I would like to have a CSS over ride, I know how to set it up so K2 picks up the template (putting a copy of the default template in /JOOMLATEMPLATE/html/com_k2 and renaming it blog for example) but where do the CSS over rides for those alternative templates go?

I can't use CSS4K2 because it doesn't work with Joomla 3. But I imagine that functionality should be part of K2 by now anyway.

This message contains confidential information

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

More
11 years 8 months ago - 11 years 8 months ago #102716 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
I have read a lot of the same problems on this website, and all the answers differ from the video. In the video, the lady does not have to copy the entire k2.css file into the template override directory, she just makes a simple .css file with the changes she wants and it works out of the box. So either the video is wrong or outdated.

The video also shows that the CSS file is loaded after the K2 one. On my site, even though K2 detects the new template in the backend, it is not loading it or the CSS. Did the CSS files get moved at some point from the templates directory (because they are not there now), and the CSS4K2 has not been updated to reflect this but simply to install on J!3.1?

Please could someone spend a little while giving an up to date (Sept 2013) tutorial in simple to understand steps on how to use the custom override which is one of the best selling points of K2, and which does not seem to work unless you have a degree in "whoknowswhat".

I think it would be a great deal of help to a lot of people, me included.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 8 months ago #102717 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Where to put css override?
Hello Joe,

The method of overriding has not changed. Since CSS4K2 is a 3rd party extension and is not develop by us and also some frameworks follow a different method, I am not aware of any changes. I suggest that you ask RC if they are using a different overriding method.

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

More
11 years 8 months ago #102718 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
Thanks for replying,

Does K2 not allow custom CSS in the same was as CSS4K2, and if so how? In other words is it possible to have sub-templates with custom CSS, and if so, where do those CSS files go, because the documentation does not say so, and the CSS files are not in the template folder.

Krikor Boghossian wrote: I suggest that you ask RC if they are using a different overriding method.


RC? Is that rockettheme or the css4k2 developer?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 8 months ago #102719 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Where to put css override?
RC is Rocket Theme.

K2 allows as many stylesheets as you want (Although you should only override k2.css or use your template's stylesheets ), it basically works the same way as com_content.

If your template uses a different method you should contact the template developer.

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

More
11 years 8 months ago #102720 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
I turned off Rockettheme, and it still doesn't work. I will post on their website asking if they have any ideas as well but still this does not seem to be working as described.

The article by Fotis Evangelou here is nearly 2 years old. I was not using K2 then but it makes no mention of where to put the CSS files, do they go inside the com_k2/templates/YOUROVERRIDE directory, or do they go in the CSS folder inside /YOURJOOMLATEMPLATE/CSS?

One line answers don't really help so please try to explain how its done.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 8 months ago #102721 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Where to put css override?
The overriden css files (including the k2.css) are in your template//css folder. But once again your template might use a different logic/framework.

The original file is located in /media/k2/assets/css . If you are putting this file in your css folder and still not seeing the changes then some extension or framework is not using (and blocking) the default method of overriding.

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

More
11 years 8 months ago - 11 years 8 months ago #102722 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
So are you saying that the CSS overrides go in /templates/YOURJOOMLATEMPLATE/html/com_k2/css or /templates/YOURJOOMLATEMPLATE/css?

Also the css file has to be called k2.css?

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

More
11 years 8 months ago - 11 years 8 months ago #102723 by jonny jackson
Replied by jonny jackson on topic Re: Where to put css override?
This is the right folder : /templates/YOURJOOMLATEMPLATE/css

simply put your css-file in to this folder. I think it has to be named k2.css...

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

More
11 years 8 months ago #102724 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
But won't that then override the default K2 styling for the entire website?

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

More
11 years 8 months ago - 11 years 8 months ago #102725 by jonny jackson
Replied by jonny jackson on topic Re: Where to put css override?
yes, only if you add additional custom changes... otherwise the ovveride doesnt make sense :)

Simply copy the css file k2.css from :

components/com_k2/css/

into

/templates/YOURJOOMLATEMPLATE/css/


and add changes as you wish...

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

More
11 years 8 months ago #102726 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
So that makes CSS4K2 obsolete or useless?

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

More
11 years 8 months ago #102727 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
I will go and try that out, see what the outcome is.

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

More
11 years 8 months ago - 11 years 8 months ago #102728 by Joe Collins
Replied by Joe Collins on topic Re: Where to put css override?
I disabled the K2 styling in my rockettheme template, and indeed used a default Joomla template instead for a while to see if that is causing this issue.

K2 allows me to pick the template from category manager, but it is still loading only the default k2.css file from the components/com_k2 folder.

Also tried with CSS4K2 disabled and enabled, same results. K2 is not loading the CSS file from JOOMLATEMPLATE/html/com_k2/css.

Is there a setting in K2 that turns off the use off sub-templates and maybe that is not enabled? I did look but it might be there.

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


Powered by Kunena Forum