[wp-hackers] splitting dynamic_sidebar()

Paul paul at codehooligans.com
Thu Jul 21 15:38:18 UTC 2011


My thought instead of trying to figure how many widgets go across the row of the footer and forcing a break. Why not add some JS which will set the height of all those widgets to the same. That way they will 'flow' to the next row as needed. 

Here is some jQuery I put together for a Property listing prototype for a client

// Spin through all the class items. Figure out the tallest. 
var grid_cell_max_height = 0;
jQuery('.portfolio div.property-summary').each(function() {
	var cells_height = jQuery(this).height();
	
	if (cells_height > grid_cell_max_height)
		grid_cell_max_height = cells_height;
});

// Now set all to the same height. 
jQuery('.portfolio div.property-summary').each(function() {
	var cells_height = jQuery(this).height(grid_cell_max_height);
});	


On Jul 21, 2011, at 11:31 AM, Christopher Ross wrote:

> My worry is that the footer only has the width for three widgets, if somebody adds a fourth it will wrap but not always to the start of the second row.
> 
> For example if the widgets look like:
> 
> 111111   222222   333333
> 111111   222222   333333
> 111111   222222   333333
> 
> The fourth widget will wrap like this:
> 
> 111111   222222   333333
> 111111   222222   333333
> 111111   222222   333333
> 
> 444444
> 444444
> 444444
> 
> But if the third widget is short, it'll wrap like this:
> 
> 111111   222222   333333
> 111111   222222   444444
> 111111   222222   444444
>                                  444444
> 
> What I want to do is insert a clear:right; after the third widget. Which will look like:
> 
> 111111   222222   333333
> 111111   222222  
> 111111   222222  
> 
> 444444
> 444444
> 444444
> 
> If I know what it is, I can do it using the specific widget name but when users can add anything, there isn't an ID or class for 'widget-3', so ... is there another method?
> 
> Chris
> 
> 
> On 2011-07-21, at 10:39 AM, Bjorn Wijers wrote:
> 
>> I'd suggest to make different sidebars. It's easier for users and more
>> robust.
>> 
>> 
>> met vriendelijke groet,
>> Bjorn Wijers
>> 
>> * b u r o b j o r n .nl *
>> digitaal vakmanschap | digital craftsmanship
>> 
>> Werkdagen:
>> Van maandag t/m donderdag vanaf 10:00
>> Vrijdag is voor experimenteren en eigen projecten.
>> 
>> Postbus 14145
>> 3508 SE Utrecht
>> The Netherlands
>> 
>> tel: +31 6 49 74 78 70
>> http://www.burobjorn.nl
>> 
>> On 07/21/2011 12:29 AM, Christopher Ross wrote:
>>> Anybody have a suggestion for how to split the dynamic_sidebar() into groups?
>>> 
>>> I have a theme that uses dynamic_sidebar() to display widgets across the bottom as a footer, but I want to include a CSS to clear the div's between the third and fourth.
>>> 
>>> c.
>>> 
>>> 
>>> 
>>> --
>>> Christopher Ross
>>> christopher.ross at rodonic.com
>>> 
>>> Rodonic - http://rodonic.com
>>> My Blog - http://thisismyurl.com
>>> 
>>> Twitter - http://twitter.com/#!/thisismyurl
>>> Facebook -  http://www.facebook.com/thisismyurlcom
>>> 
>>> (416) 900-3731
>>> 
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>> 
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> 
> 
> 
> 
> --
> Christopher Ross
> christopher.ross at rodonic.com
> 
> Rodonic - http://rodonic.com
> My Blog - http://thisismyurl.com
> 
> Twitter - http://twitter.com/#!/thisismyurl
> Facebook -  http://www.facebook.com/thisismyurlcom
> 
> (416) 900-3731
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list