Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Trying To Understand Grids And Spans - V.4.1.5 Rate Topic   - - - - -

 
  • El Nucli
  • Junior Member
  • Authorized Reseller
  • Join Date: 12-Apr 10
  • 55 posts

Posted 28 July 2014 - 09:15 AM #1

Hi Folks,

While trying to adapt a layout to match a given design, we encounter an strange grid-span behaviour that we don't know how to face, or what causes it. I attach a screenshot with annotations.

The fact is that we need to nest some grids. The main design is 12 column width. The first grid is of 12 columns, and span 12. The next level has two grids, one of 2 columns, and one of 10 columns, both of them having the same span (span 2 and span 10). BUT then, when we create two grids inside the 10 column grids, they span above the total size of the container, and thus we have a grid-7 that spans 8, and a grid 3 that spans 4.

This is causing us some headaches when implementing the design, as we can't rely on the columns widths for the content inside those grids.

Does anybody know where is the trick or what do we do bad? Any comment or guidance would be highly appreciated.

Thanks in advance,

Attached Thumbnails

  • strange-grid-span-behaviour.png


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11770 posts

Posted 28 July 2014 - 08:11 PM #2

Have not confirmed your info, but if you have a grid width of 7 columns, the span within it should be span7. Where is the code being generated that is using the class="span9"? It could be there's a defect that you should report via bugtracker if you can provide details on how they can reproduce it.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • El Nucli
  • Junior Member
  • Authorized Reseller
  • Join Date: 12-Apr 10
  • 55 posts

Posted 28 July 2014 - 10:33 PM #3

Hi tbirnseth,

Have not confirmed your info, but if you have a grid width of 7 columns, the span within it should be span7. Where is the code being generated that is using the class="span9"? It could be there's a defect that you should report via bugtracker if you can provide details on how they can reproduce it.


Many thanks for your interest on the subject, I appreciate your help in tons and tons of posts.

We've been dealing with that issue for some days, and really we don't know if we are doing something bad, or if it's an issue with our design, or a bug.

Certainly, maybe we are being too cautious and it's time to post it on the bug tracker, as you suggest. We'd be thankful if you or anyone else could confirm such behaviour on another cs-cart installation (v.4.1.5).

Any further comment on the topic would help us narrowing the causes and make for a better case on the bug tracker.

Thanks in advance,

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11770 posts

Posted 29 July 2014 - 01:59 AM #4

You'd have to post a link to the page to look. But I'm guessing it's simply a typo in the templates somewhere..... Can you provide more specifics?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • El Nucli
  • Junior Member
  • Authorized Reseller
  • Join Date: 12-Apr 10
  • 55 posts

Posted 07 August 2014 - 07:47 AM #5

Hi Tbirnseth,

You'd have to post a link to the page to look. But I'm guessing it's simply a typo in the templates somewhere..... Can you provide more specifics?


Sorry for the delay in the follow up of that matter, I was out for a few days.

We posted the same question to Cs-cart support team and that's their answer:

The span value in question indicates the relation of the current grid width to the parent one. This value is shown only for the Full width and Fluid width layouts. Please let me explain how it is generated. If the layout type is not Fixed and the layout width for the fluid layout is more than 0, the block manager demonstrates you the relation of the grid width to the parent one. fn_get_grid_fluid_width calculates the value according to the following algorithm:

function fn_get_grid_fluid_width($width_schema, $parent_width, $grid_width)
{
	$relation = 0;
	if (empty($parent_width)) {
		$relation = $grid_width;
	} else {
		$relation = $width_schema * (($grid_width * 100 / $parent_width) / 100);
	}
	return round($relation);
}
As a result, depending on the variables values sent to the function, the span value can be different from the grid one. I hope this explains the situation. Please feel free to contact us if you have any further questions.


So it seems from their explanation that the span value must be understood as a ratio (in relation to its parent grid) and not as an absolute value. In our case (following the screenshot from our first post n this thread), I understand that this should be read as: "the grid 7 will span-occupy 8/(8+4)=75% of the parent grid, which is a 10 column grid".

Are we interpreting this correctly?

All in all, the problem for us was that we used the span in the html generated to customize the site styles, and the resulting html was giving us a "span 8" and "span 4" labels where we expected "span 7" and "span 3" labels. This was a nightmare when editing CSS, as we expected that each label would indicate the number of the columns...

I enclose a screenshot of this page: http://af.webdeprova...&category_id=21 that I've setup in order to illustrate the issue. Using firebug, the html rendered labels each div with the "relative" span number, instead of the grid number.

Any comment or further discussion will be appreciated!

Thanks in advance,

P.S.: I've updated the link in order to show also a block in the grid10 container.

Attached Thumbnails

  • strange-grid-span-behaviour-html.png


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11770 posts

Posted 08 August 2014 - 02:19 AM #6

Wow, you must have sent a pack of cookies to the helpdesk. Rarely have I ever seen a description that was technical and complete from the helpdesk....

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.