ArchiveDecember, 2010
Browsing all articles from December, 2010

Thanks to a comment made by Gila, a bug has been found in Dynamic Widgets version 1.3.7 which prevents subsequent widgets with an opposite config for WPML to behave correctly. The bug is fixed in the development version 1.3.7.3.

My apologies for any inconvience caused by this bug.

45

Dynamic Widgets 1.3.7

Finally, a bit later than expected a new version of Dynamic Widgets is there. One of the reasons for the delay is a bug found by Mike from The Minor Site which took some time to get it fixed. It turned out when the bug was already fixed the Suffusion theme he is using, acted funny by passing unrealistic data to Dynamic Widgets which in its turn got confused. Luckily we got around it by switching the plugin to ‘OLD’ method.

Anyway, I’ve just released version 1.3.7. Compared to the previous version, the following has been added and fixed:

  • Added more l10n text strings.
  • Added French language files (locale: fr_FR) – Merci beaucoup Alexis!
  • Added language (WPML) as an option.
  • Added hierarchical inheritance support for Pages and Custom Post Types
  • Bugfix for unexpected behavior when two widgets are in opposite config of eachother.
  • Fixed a couple of l10n text strings
  • Changed UI in edit options screen (Thanks Alexis for the help!).
  • Speeded up the removing process in FILTER method.

I’m getting several questions what the difference is between the Filter and the Old method used in Dynamic Widgets. Both methods has its advantages and disadvantages. Which method works best for you is something for you to decide. However, I’d recommend not touching the method option, so using the (default) Filter method, when you start using this plugin and see how it performs.

The Filter method controls the widgets before a sidebar is rendered by WordPress. When a sidebar becomes empty (and there are no default widgets set by the theme), the sidebar will not be rendered by WordPress, leaving nothing behind. This is particular very usefull when your theme uses for example a border around the sidebar. Disadavantage of this method is, it has to process all applicable widgets for every sidebar it comes across during the time the page is rendered. When you have many sidebars and/or many options set for the widgets this might slow down the rendering significant.

The Old method controls the widgets at the moment the sidebars are rendering. It deletes the widgets from the sidebar. This can leave you behind with a rendered empty sidebar. When your theme is using borders around it, it will be noticeable, otherwise probably not. This method is faster as the processing is done only once for all sidebars together. This is very useful for users who have many sidebars and/or widgets.

Now what if you have many sidebars and/or widgets, you notice a significant slow down of rendering and also a theme which uses borders around sidebars? Both methods are not really usable at that point. Well, there is a way, but that needs some hacking in your theme involved. You should have some PHP programming expierence before you would ever think about this. You use the Old method for this hack and the PHP output buffering functions. You have to find in your theme files where the sidebar is called. At that point you replace the following example PHP code. Please note this PHP code needs to be adapted to the theme you are using. You can’t just copy – paste! I’m not responisble for any damage caused.

ob_start();
$success = dynamic_sidebar($index);
$content = ob_get_clean();
if ($success) {
  do_output_div($content);
}

When you use the since WordPress 3.0 standard Twenty Ten theme, you should have a look to WP Weaver (also used here) which has this piece of code adapted and other nice features added to this standard theme.

Like Dynamic Widgets? Like my FB!

All about QURL