review of inline css code listing_div

  • Posts: 846
  • Thank you received: 92
11 years 1 week ago #169353

-- Joomla version -- : 2.5.22
-- PHP version -- : 5.3.9
-- Browser(s) name and version -- : many many

in listing_div.php HKS team i think want to help user so a variable width is define in line 80 and use in line 120

line 80
$width = (int)(100/$columns)-1;

line120
<div class="hikashop_product hikashop_product_column_Y hikashop_product_row_X " style="width:<?php echo $width;?>%;">

I really think that to be flexible ( not in the css meaning) , all inline style must be manage has a parameter to let CSS designer enable disable inline style and be able to create their own css file without a) using !important or/and b) change the php file content ( if they know php code syntax API and ). Layout override is the way but need to know that we could use this way .

in a way width must be manage by mediaqueries so why put a width CSS properties inline ?

regard's

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
11 years 1 week ago #169362

The width doesn't depend on the media queries but on the number of columns that you configure in the options of your listings.
Since we don't know how many columns you're going to use, and that it depends on a parameter in PHP, it can't be handled with CSS only (it requires calculating the width in PHP based on the option).
And creating plenty of classes width_50_percent, width_33_percent just to have then .width_50_percent{ width:50%;} in your CSS is the same as putting the CSS width directly in the view. So there is no point in changing this code.
This code is not about styling but about layout.
The media queries are then used to change the width based on the resolution of the screen with CSS.

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

  • Posts: 846
  • Thank you received: 92
11 years 1 week ago #169481

Hi
Even if the code is not about style ( color shape ) but layout it still use css properties / values that are inline and not in a css file. Compute layout could be( handle) achieve using compass with grid layout framework like susy or zen grid far more easy than use bootstrap layout .

If you set in backend parameter the number of column for a desktop layout and need another number when width screen decrease how hikashop php code in joomla can manage this ?
I think in this case that mediaqueries ( with css preprocesor) is more suitable than php ( easy , better than nothing) .
What i like in HKS or Seblod and perhaps other extension is the number of selectors generic and specific ( that use id ) that make CSS designer happy ( without omit prefix ) and the override that let us remove /change php layout code inside php file .

Another problem seem i don't read layout documentation for HKS menu item .In a way the layout is specific to templates but each php file that use css parameters define a layout not find in HKS documentation . So we need to have a look to the code source to understand the logic behind php joomla parameters variables . Since many users ( most of HKS users ) buy a template ( nothing wrong about this it is the easy efficient way to do ) and have answers to their layout issue by HKS team all is fine and great !!

what is strange in HKS is that message error seem handle/appear/show in the html code locate inside php file not in the standart joomla location <jdoc:include type="message" /> . Doing so can break the layout ( i must admit that the problem can also come from the layout design ) .

The documentation for layout is reduce in the demo HKS website. we don't know the result if we mix number of column and number of items !!! If we define div with 3 column and we set 12 items . How is rendr ou layout if we have 15 products and so 3 last items over 12 : next link pagination appear ? items are delete/ignore/hidden ? ,.... I don't read information in documentation. I don't search information in he forum only read the documentation accessible from Joomla BE page
[url=http://demo.hikashop.com/administrator/index.php?option=com_hikashop&ctrl=menus&task=edit&cid[]=105] demo.hikashop.com/administrator/index.ph...=menus&task=edit&cid []=105[/url]


here an attachement a study ( begin) of the grid of HKS demo website e commerce ( static/fixed only ,no fluid , no RWD ) that could be use to recreate the psd .

Attachments:
Last edit: 11 years 1 week ago by lionel75.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 1 week ago #169517

Hi,

Okay, we will take that in consideration.

Enjoy the rest of your week end !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 846
  • Thank you received: 92
11 years 1 week ago #169522

Hi
I think that some time the prefix is not efficient if layout need a lot of selector definition in the
css files. In this case i think a css file must be load for each specific item menu .
the paht name of the css file could be set manually for each menu item

regard's

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

Time to create page: 0.051 seconds
Powered by Kunena Forum