Keyword

Mobile templates and inline styling issue

More
14 years 3 months ago #83722 by Renea
First, awesome product!I am trying to make MobileJoomla play nicely with K2 and have run into my first display issue. Not sure how to tackle this.When you display subcategories on main category pages, the width of the DIV tag for subCategoryContainer is computed and added to the DIV tag via an inline style.components/com_k2/templates/default/category.php
<div class="subCategoryContainer" style="width:<?php echo number_format(100/$this->params->get('subCatColumns'), 1); ?>%;">
I need to override the style="width" for the class subCategoryContainer in my mobile template but I can not, since the style is inline.I was thinking about removing the style declaration all together from category.php and defining a width=20% in my template css (since all my subcategory listings are always 5 columns on every page).Anyone have a better idea?

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

More
14 years 3 months ago #83723 by Simon Wells
Replied by Simon Wells on topic Mobile templates and inline styling issue
Ok, firstly to prevent modifying your core (default) k2 template, you need to create a k2 template within your joomla template. I have a guide on how to create a K2 template, just transfering the data from K2Joom.com to simon.getk2.org and will advise of a new link shortly.

Once we have your new template files in place, we can then set your category to point to the new template and then start making changes.

Please be patient whilst I get these files for you.

Simon
K2 support

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

More
14 years 3 months ago #83724 by Renea
Replied by Renea on topic Mobile templates and inline styling issue
Familiar with making new templates. Will go ahead and do that.
Had an idea while doing the dishes (2nd best Ah Ha location in my house)...

Remove the "style" but leave the php that does the math. Append the php code to the end of subCategoryContainer. So new class would be subCategoryContainer20 (in my case).

Then make new styles in the k2 CSS files, one for each possible subCategoryClass (100, 50, 33, 25, 20, etc)

Logical?

Simon Wells (K2 Support) said:Ok, firstly to prevent modifying your core (default) k2 template, you need to create a k2 template within your joomla template. I have a guide on how to create a K2 template, just transfering the data from K2Joom.com to simon.getk2.org and will advise of a new link shortly.
Once we have your new template files in place, we can then set your category to point to the new template and then start making changes.

Please be patient whilst I get these files for you.

Simon
K2 support

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

More
14 years 3 months ago #83725 by Renea
Replied by Renea on topic Mobile templates and inline styling issue
I gave my idea a try and it seems to work. Would appreciate feedback on whether or not this is a good ide. (or maybe a better idea if you have one - not rushing, just sharing)



I took the decimal place out of the php function so it would just return a whole number value.

Then added this to k2.css
div.subCategoryContainer100 {float:left; width: 100%;}
div.subCategoryContainer50 {float:left; width: 50%;}
div.subCategoryContainer33 {float:left; width: 33%;}
div.subCategoryContainer25 {float:left; width: 25%;}
div.subCategoryContainer20 {float:left; width: 20%;}

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

More
14 years 3 months ago #83726 by Simon Wells
Replied by Simon Wells on topic Mobile templates and inline styling issue
Hi Renea,

Again, provided you created you new K2 template so as not to affect the core and if it works, then its job done.

Regards,

Simon
K2 Support

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


Powered by Kunena Forum