COMMUNITY FORUM
css4K2 doesn't seem to be working?
- Ruth Cheesley
-
Topic Author
- Offline
- Senior Member
Less
More
14 years 9 months ago #86756
by Ruth Cheesley
Ruth Cheesley
Virya Technologies
css4K2 doesn't seem to be working? was created by Ruth Cheesley
Hi guys,Not sure I class myself as an advanced user but hey ho!I've got K2 set up and have tons of categories, basically I need to use CSS to style each one differently. I found and installed the css4K2 plugin (but couldn't find the developers PDF file it makes reference to) but I can't get it working.Here is what I've done:Install pluginEnable pluginCopy k2.css to /templates/mysitetemplate/html/com_k2/templates/defaultI got a bit confused here as I didn't have a "templates" folder originally, but all my templates were within /com_k2/ and working just fine. I moved them all into a folder called "templates" and still work fine.Renamed k2.css to mysitetemplate_style.cssCreated style.css in /templates/mysitetemplate/html/com_k2/templates/myk2templateAssigned myk2template to K2 categoryNow, I'm assuming following these steps should then mean that whenever that category is displayed it will be using style.css - the areas I need to change are the category layout so I copied these from k2.css into style.css and made the necessary changes, but these are not being replicated.If anyone can point out the error of my ways it'd be most appreciated :)Ruth
Ruth Cheesley
Virya Technologies
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
Less
More
- Posts: 955
14 years 9 months ago #86757
by Simon Wells
Replied by Simon Wells on topic css4K2 doesn't seem to be working?
Hi Ruth
OK, you template structure /templates/mysitetemplate/html/com_k2/templates/default is correct.
I would rename the default to something more meaningful else you will have two defaults listed in the category params, so for this explanation i am going to be referring to it as /templates/mysitetemplate/html/com_k2/templates/k2template1
When you place the k2.css file in /k2template1 you will need to rename the css file to k2template1_style.css
Now you can create as many k2 templates as you wish, copy the folder /templates/mysitetemplate/html/com_k2/templates/k2template1 and then rename your new copy to k2template2 and your css file to k2template2_style.css
You will now have two k2 templates that can be selected from the category parameters.
If you still have default k2.css enabled, what will happen is this.
The default k2 template and its css found in components/com_k2 etc, will be loaded all the time, until such time as a category with a valid k2 template has been set.
When that category is called, it will then use the css file in the template folder and override the default css.
If no css is found, it will still call the default k2.css but use any layout changes from within that category.
To help keep over rides as light as possible, you could just use the relevant/needed classes within your k2 templates css file.
So, if you wanted different categories using the same layout but with different block background colours, then just add the relevant class and colour change per css file.
I hope that makes sense.
You know how to contact me if you have further questions.
Simon
K2 Support
OK, you template structure /templates/mysitetemplate/html/com_k2/templates/default is correct.
I would rename the default to something more meaningful else you will have two defaults listed in the category params, so for this explanation i am going to be referring to it as /templates/mysitetemplate/html/com_k2/templates/k2template1
When you place the k2.css file in /k2template1 you will need to rename the css file to k2template1_style.css
Now you can create as many k2 templates as you wish, copy the folder /templates/mysitetemplate/html/com_k2/templates/k2template1 and then rename your new copy to k2template2 and your css file to k2template2_style.css
You will now have two k2 templates that can be selected from the category parameters.
If you still have default k2.css enabled, what will happen is this.
The default k2 template and its css found in components/com_k2 etc, will be loaded all the time, until such time as a category with a valid k2 template has been set.
When that category is called, it will then use the css file in the template folder and override the default css.
If no css is found, it will still call the default k2.css but use any layout changes from within that category.
To help keep over rides as light as possible, you could just use the relevant/needed classes within your k2 templates css file.
So, if you wanted different categories using the same layout but with different block background colours, then just add the relevant class and colour change per css file.
I hope that makes sense.
You know how to contact me if you have further questions.
Simon
K2 Support
Please Log in or Create an account to join the conversation.
- Ruth Cheesley
-
Topic Author
- Offline
- Senior Member
14 years 9 months ago #86758
by Ruth Cheesley
Ruth Cheesley
Virya Technologies
Replied by Ruth Cheesley on topic css4K2 doesn't seem to be working?
Hi,
Thanks for the response, I was following this tutorial:
simon.getk2.org/downloads/free-extensions/item/26-css-4-k2/2...
which is where I think I got in a pickle.
Here are the steps which confused me (highlighted in bold) which suggest that you put the name of the Joomla! site template as the css file name within the default folder (no mention is made of it being needed in all template folders), and that a file called style.css should be in each of the template folders. I guess it makes sense to people familiar with the way it works, but even after re-reading it several times I was completely confused.
3. Copy the k2.css found components/com_k2/css and place in your k2 template folder in your Joomla template folder: /templates/JOOMLATEMPLATE/html/templates/default
4. Rename the css to JOOMLATEMPLATE_style.css in the appropriate K2 theme folder.
5. Create or Edit a K2 Category and select a template to use, preferably one that you have added a style.css file in.
May I suggest these are re-worded to make it slightly clearer for noobs like me? Your description is perfect and I could immediately see what I'd done wrong.
Thanks again for the help, much appreciated :)
Ruth
Thanks for the response, I was following this tutorial:
simon.getk2.org/downloads/free-extensions/item/26-css-4-k2/2...
which is where I think I got in a pickle.
Here are the steps which confused me (highlighted in bold) which suggest that you put the name of the Joomla! site template as the css file name within the default folder (no mention is made of it being needed in all template folders), and that a file called style.css should be in each of the template folders. I guess it makes sense to people familiar with the way it works, but even after re-reading it several times I was completely confused.
3. Copy the k2.css found components/com_k2/css and place in your k2 template folder in your Joomla template folder: /templates/JOOMLATEMPLATE/html/templates/default
4. Rename the css to JOOMLATEMPLATE_style.css in the appropriate K2 theme folder.
5. Create or Edit a K2 Category and select a template to use, preferably one that you have added a style.css file in.
May I suggest these are re-worded to make it slightly clearer for noobs like me? Your description is perfect and I could immediately see what I'd done wrong.
Thanks again for the help, much appreciated :)
Ruth
Ruth Cheesley
Virya Technologies
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
Less
More
- Posts: 955
14 years 9 months ago #86759
by Simon Wells
Replied by Simon Wells on topic css4K2 doesn't seem to be working?
Ruth,
I see the error of my way, apologise for the error.
You may also find my templating guide usefull to: simon.getk2.org/component/k2/item/91-templating
This is going to get a makeover in the coming days with clearer written instructions and screen shots as well as some additional tricks that have been learnt for running multiple k2 template within multiple joomla templates.
Simon
K2 Support
I see the error of my way, apologise for the error.
You may also find my templating guide usefull to: simon.getk2.org/component/k2/item/91-templating
This is going to get a makeover in the coming days with clearer written instructions and screen shots as well as some additional tricks that have been learnt for running multiple k2 template within multiple joomla templates.
Simon
K2 Support
Please Log in or Create an account to join the conversation.