- Posts: 6
COMMUNITY FORUM
CSS editing from K2 administrative back-end
- WritersLatte
-
Topic Author
- Offline
- New Member
Less
More
15 years 1 month ago #81808
by WritersLatte
CSS editing from K2 administrative back-end was created by WritersLatte
I love K2, and although more and more template creators are implementing K2 styles, I still need to tweak them pretty often.So what I would really like to do is be able to edit the k2.css from within the back end of Joomla, rather than always uploading a new file.
Please Log in or Create an account to join the conversation.
- Dylan
-
- Offline
- New Member
Less
More
- Posts: 9
15 years 4 weeks ago #81809
by Dylan
Replied by Dylan on topic CSS editing from K2 administrative back-end
Hi Marni. Why not just copy the k2.css to your Joomla template directory and add an @import k2.css in the very top of your template's default css file. If you do that as a standard procedure for each template that isn't a lot of work and you can edit css from the backend
Please Log in or Create an account to join the conversation.
- WritersLatte
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
15 years 4 weeks ago #81810
by WritersLatte
Replied by WritersLatte on topic CSS editing from K2 administrative back-end
Thanks Dylan. I have done this on smaller sites, and it works great. It especially helped in learning all the K2 classes. This is more of a 'wish list' post. On one of my larger sites I've gone slightly over the top. I have multiple K2 templates; a blog layout, article layout, and directory layout. :)
Dylan said:Hi Marni. Why not just copy the k2.css to your Joomla template directory and add an @import k2.css in the very top of your template's default css file. If you do that as a standard procedure for each template that isn't a lot of work and you can edit css from the backend
Dylan said:Hi Marni. Why not just copy the k2.css to your Joomla template directory and add an @import k2.css in the very top of your template's default css file. If you do that as a standard procedure for each template that isn't a lot of work and you can edit css from the backend
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
15 years 4 weeks ago #81811
by william white
Replied by william white on topic CSS editing from K2 administrative back-end
There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
Less
More
- Posts: 955
15 years 4 weeks ago #81812
by Simon Wells
Replied by Simon Wells on topic CSS editing from K2 administrative back-end
Hi William, you might be thinking of the css4k2 plugin?
Full details of templating found here and the ccs4k2 can be found here.
William White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
Full details of templating found here and the ccs4k2 can be found here.
William White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
Please Log in or Create an account to join the conversation.
- Dylan
-
- Offline
- New Member
Less
More
- Posts: 9
15 years 4 weeks ago #81813
by Dylan
Replied by Dylan on topic CSS editing from K2 administrative back-end
I admit the core Joomla versus K2 terminology can be confusing at times, but copying to /templates/your_joomla_template/html/k2/your_k2_template is not what I mean. I'm talking about k2.css copied to /templates/your_joomla_template/css/k2.css
That is not for the k2 sub-templates but for the default k2.css classes.
Config K2 not to use K2.css, all k2.css are defined in your_joomla_template and it will show in the list of files when clicking edit css from the Joomla backend through Extensions > template manager > edit cssWilliam White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
That is not for the k2 sub-templates but for the default k2.css classes.
Config K2 not to use K2.css, all k2.css are defined in your_joomla_template and it will show in the list of files when clicking edit css from the Joomla backend through Extensions > template manager > edit cssWilliam White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
Less
More
- Posts: 955
15 years 4 weeks ago #81814
by Simon Wells
Replied by Simon Wells on topic CSS editing from K2 administrative back-end
Hi Dylan,
No problem, just passing the info to William.
Simon
Dylan said:I admit the core Joomla versus K2 terminology can be confusing at times, but copying to /templates/your_joomla_template/html/k2/your_k2_template is not what I mean. I'm talking about k2.css copied to /templates/your_joomla_template/css/k2.css
That is not for the k2 sub-templates but for the default k2.css classes.
Config K2 not to use K2.css, all k2.css are defined in your_joomla_template and it will show in the list of files when clicking edit css from the Joomla backend through Extensions > template manager > edit cssWilliam White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
No problem, just passing the info to William.
Simon
Dylan said:I admit the core Joomla versus K2 terminology can be confusing at times, but copying to /templates/your_joomla_template/html/k2/your_k2_template is not what I mean. I'm talking about k2.css copied to /templates/your_joomla_template/css/k2.css
That is not for the k2 sub-templates but for the default k2.css classes.
Config K2 not to use K2.css, all k2.css are defined in your_joomla_template and it will show in the list of files when clicking edit css from the Joomla backend through Extensions > template manager > edit cssWilliam White said:There is a comment here somewhere that talks about coping the k2.css to your template/html/k2/YOURTEMPLATE directory and renaming it YOURTEMPLATE.CSS and overriding the default css for just that template. Dont think you can edit them from the backend by doing that, but you can make different changes to different templates and then choose them.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
15 years 4 weeks ago #81815
by william white
Replied by william white on topic CSS editing from K2 administrative back-end
I understsnd
At some ptoint it becomes preference as I always use fireftp to push back and forth and keep the latest copy of what I'm working on on a usb stick
At some ptoint it becomes preference as I always use fireftp to push back and forth and keep the latest copy of what I'm working on on a usb stick
Please Log in or Create an account to join the conversation.
- Dylan
-
- Offline
- New Member
Less
More
- Posts: 9
15 years 4 weeks ago #81816
by Dylan
Replied by Dylan on topic CSS editing from K2 administrative back-end
For me, I never use Joomla back-end to edit any template files. No color coding plus I keep stuff intentionally outside of /templates/joomla_template/css
Please Log in or Create an account to join the conversation.
- WritersLatte
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
15 years 4 weeks ago #81817
by WritersLatte
Replied by WritersLatte on topic CSS editing from K2 administrative back-end
I don't make major changes from within Joomla either. But sometimes I just need to tweak one or two things. That's when I don't want to use ftp to upload, download, or sync.
Please Log in or Create an account to join the conversation.
- Dylan
-
- Offline
- New Member
Less
More
- Posts: 9
15 years 4 weeks ago #81818
by Dylan
Replied by Dylan on topic CSS editing from K2 administrative back-end
Okay, might as well get the full procedure for copying default k2.css to your joomla template. Seeing as I never use it, I naturally forgot one big step: the images called from css... duh...
Steps
1. Locate the file /components/com_k2/css/k2.css. Copy this to /templates/your_joomla_template/css/k2.css
Note: in the source directory you will also find k2_ie6.css and k2_ie7.css. You do not need to copy these as they will not be used (by way of conditional comments) when you disable use default k2 css. And besides that, in version 2.2 they are empty anyway ..?
2. Locate the directory /components/com_k2/images/ and copy the contents, including subdirs to /templates/your_joomla_template/images/
These images are used for instance for your k2 rss feed or networking buttons. Of course you can replace/modify both images and css as desired.
3. Locate your Joomla templates default css file. This will most likely be something like /templates/your_joomla_template/css/template_css.css.
Open this file and at the very top add the following @import url("k2.css");
4. Configure K2 not to use default css. In Joomla backend click on Components > K2 and then click on Parameters located in the upper right corner of the page. In the list of parameters set Enable K2 default css to no and click Save.
Now the file /templates/your_joomla_template/css/k2.css will be used for the styling of default K2 classes. You can edit this file by hand or from the Joomla backend through Extensions > Template Manager > [select template] > Edit CSS > [select k2.css]
Change according to your needs, such as for instance using the same font-family everywhere. Of course you can always clear the font-family entire, in which case all fonts will inherit from your Joomla template (as defined for body and/or html)
If you use K2 sub-templating including introducing custom styles you can add them.
Note: if for some reason you (temporarily) want to change back to default K2 css, such as when you messed up big-time... do not forget to comment the @import in your template default css file. Replace the @import url("k2.css"); from step 3 with /* @import url("k2.css"); */ or delete the line entirely.
Steps
1. Locate the file /components/com_k2/css/k2.css. Copy this to /templates/your_joomla_template/css/k2.css
Note: in the source directory you will also find k2_ie6.css and k2_ie7.css. You do not need to copy these as they will not be used (by way of conditional comments) when you disable use default k2 css. And besides that, in version 2.2 they are empty anyway ..?
2. Locate the directory /components/com_k2/images/ and copy the contents, including subdirs to /templates/your_joomla_template/images/
These images are used for instance for your k2 rss feed or networking buttons. Of course you can replace/modify both images and css as desired.
3. Locate your Joomla templates default css file. This will most likely be something like /templates/your_joomla_template/css/template_css.css.
Open this file and at the very top add the following @import url("k2.css");
4. Configure K2 not to use default css. In Joomla backend click on Components > K2 and then click on Parameters located in the upper right corner of the page. In the list of parameters set Enable K2 default css to no and click Save.
Now the file /templates/your_joomla_template/css/k2.css will be used for the styling of default K2 classes. You can edit this file by hand or from the Joomla backend through Extensions > Template Manager > [select template] > Edit CSS > [select k2.css]
Change according to your needs, such as for instance using the same font-family everywhere. Of course you can always clear the font-family entire, in which case all fonts will inherit from your Joomla template (as defined for body and/or html)
If you use K2 sub-templating including introducing custom styles you can add them.
Note: if for some reason you (temporarily) want to change back to default K2 css, such as when you messed up big-time... do not forget to comment the @import in your template default css file. Replace the @import url("k2.css"); from step 3 with /* @import url("k2.css"); */ or delete the line entirely.
Please Log in or Create an account to join the conversation.
- Dylan
-
- Offline
- New Member
Less
More
- Posts: 9
15 years 3 weeks ago #81819
by Dylan
Replied by Dylan on topic CSS editing from K2 administrative back-end
Note: I understand wanting to tweak a bit, adding a pixel here or there or minor things like that. In my case I extensively use php in style-sheets, the same way I use php to echo javascript in my templates index.php file. I would not want my customers to edit these files through the Joomla GUI. All the languages are mixed up and a syntax error is very easily made, especially without color coding or without having full understanding of php, html, css and javascript
A very small example would be the cross-browser opacity using php style-sheets as I described here cross-browser-opacity-using-php-stylesheets
You'll understand I don't want customers to be easily able to edit these stylesheets. You'll also understand I'm reluctant to use Joomla GUI myself to do "minor" tweaks
A very small example would be the cross-browser opacity using php style-sheets as I described here cross-browser-opacity-using-php-stylesheets
You'll understand I don't want customers to be easily able to edit these stylesheets. You'll also understand I'm reluctant to use Joomla GUI myself to do "minor" tweaks
Please Log in or Create an account to join the conversation.