Dynamic Widgets 1.4.0

WordPress 3.1 is realeased and as promised, hereby I also release the next version of Dynamic Widgets. A lot has been added and changed compared to the previous 1.3.7 version. Mainly due to the great feedback from many users. Thank you all for supporting the development of this plugin!

Below you’ll find all the additions, changes and other things.

  • Added more l10n text strings
  • Added support for browser options.
  • Added support for attachments.
  • Added support for Custom Post Type Archive pages (native in WordPress 3.1, via plugin in 3.0.x).
  • Added support for BuddyPress Component pages.
  • Added support for BuddyPress Group pages.
  • Added German language files (locale: de_DE) – Vielen dank Daniel!
  • Added Spanish language files (locale: es_ES) – Muchas gracias Eduardo!
  • Bugfix for unexpected behavior when subsequent widgets are in opposite config for WPML.
  • Bugfix for not correct displaying of options string in the widget admin when having options set for childs in Pages or Custom Post Types.
  • Bugfix for an error 404 (file not found) when an error occurs while saving options.
  • Bugfix for unnecessary double creation of the hierarchical tree in Static Pages and Custom Post Types.
  • Modified admin UI for compatibility with WordPress 3.1.
  • Upgrade for WP Shopping Cart / WP E-Commerce to support version 3.8 *** SEE NOTES BELOW ***
  • Workaround in admin UI when using (a child of) the default BuddyPress theme or the BP Template Pack plugin bombing the accordion.
  • Modularized admin scripts
  • Standarized the use of JavaScript (jQuery)

Notes about WPEC 3.8
With this version, Dynamic Widgets supports version 3.8 of WPEC. Unfortunately because of the change by WPEC, when you upgrade WPEC you’ll have to redo all rules you’ve created within Dynamic Widgets for WPEC manually. It was nog possible for me to find out how to convert these to the new system used by WPEC. For your convience I’ve created a WPEC config dump generator to be able to give an overview of all the WPEC rules created in Dynamic Widgets to make recreating the rules easier. Please note the generator only works correctly when the WPEC product categories database table still exists and you did not add or modified any rule in Dynamic Widgets. The generator can be found at the Dynamic Widgets overview page by clicking on the ‘Advanced >’ link at the bottom of the page.

86 Comments to “Dynamic Widgets 1.4.0”

  • great plugin, but I think one thing that’s missing is the custom taxonomies?
    for example if I have a navigation menu widget in the sidebar that lists taxonomies for a custom post type and I only want to show it on the CPT taxonomy index page

    • Hi Paul,
      Thanks for the suggestion! I’ve had the same request a few days ago. Will definetly look into this.

  • cool, it pains me to have to use another plugin in the meantime

    • Hi Paul,
      I’ve added Custom Taxonomies support to Custom Post Types in development version 1.4.0.3.

      • I have the updated version: v1.4.0.13 and I’m editing a widget to only a single post with a tag. I can only see the categories and not the tags.

        Thanks and I LOVE your plugin.

        • oh yeah, there is no custom post type like the other version had.

          • Hi Britt,

            I’m not sure what you exactly mean with this comment. Do you mean you don’t see options within Dynamic Widgets for Custom Post Types while you have Custom Post Types?

        • Hi Britt,

          You can edit a widget for tags at the tag edit page. Go to Posts > Post Tags > Click a tag and you should see an option for Dynamic Widgets when you have enabled the ‘Make exception rule available to individual posts and tags.’ under Single Posts.

  • Your plugin is the foundational block of my website. It allows me to put relevant maps together with content. However, you’ve clipped my wings. I just discovered that since I have more than 500 pages, then Dynamic Widgets is disabled. Ouch!

    I’m sure you’re did it “for my own good” but I’m not sure I can live without it. I have some widgets that I need to update, but I cannot update them because if I do I won’t be able to conditionally put the content back where I want it because DW is disabled. Ideas/suggestions?

    • Hi Will,
      Just to make sure for myself. You can’t change anything for static pages? The 500 limit is for building the hierarchical tree. That’s been shut off when you have more than 500 pages. In correct behaviour Dynamic Widgets should just display a flat list of all the pages.

  • Hi, thank you for this very handy widget. I also use WordPress FAQ manager. How can ik disable some of my wdgets when showing a FAQ item? As the instructions mention: The FAQ Manager plugin uses a combination of custom post types, meta fields, and taxonomies. The plugin will automatically create single posts using your existing permalink structure. And the FAQ categories and tags can be added to your menu using the WP Menu Manager.

    It seems that no of the options within Dynamic Widgets seems to be able to deactivate a widget when a FAQ is shown.

    Can you help me with this one?

    Best regards, Janno

    • Hi Janno,

      Did you try the latest development version 1.4.0.13? It has support for taxonomies within custom post types. I haven’t checked the WP FAQ Manager, so I’m not sure it will be the solution.

      • Hi Jacco,

        version 1.4.0.13 solved my problem with WP FAQ Manager.

        Many thanx and best regards,
        Janno Hordijk

  • Great plugin. Just one question. I’m trying to limit 1 widgets to each category. Which works great except when a post is in multiple categories. Any way of making a Widget Dynamic based on whether it is in multiple categories?

    E.g. show this if in 1 category, don’t show if in 2 or more categories?

    • So, corect me if I’m wrong… You want a widget appear only when a single post has only the specified category? The widget should be hidden when the number of categories > 1, even the post is in a specified category.

  • Hi Jacco,

    Yes that’s correct. Let me illustrate why… I want to insert adverts specific to each category. However, some posts are in one or more categories and I don’t want two lots of adverts loading onto the page. My thinking was therefore to have a logic that says something like:

    If this post is in a single category, and matches the category ID specified, show the widget

    Then I would create a different widget for any posts in multiple categories with this kind of logic:

    If the post is in multiple categories, show this widget.

    I had tried something similar with a plugin called Widget Logic but I can;t get it to work. Here was the actual logic code I was using there for a particular category:

    global $post; $cats = wp_get_object_terms( $post->ID, 'category' ); if( count( $cats ) > 1 ) return false; return ( is_category( 35 ) || is_single() && in_category( 35 ) );

    Does that help clarify matters? Thanks for any further thoughts…

    • Yeah, I do understand what you’re looking for. As you might have guessed already, it’s not a feature in Dynamic Widgets. This is quite an advanced feature which I’m afraid will not be used by many user of Dynamic Widgets. Writing this yourself with PHP code is actually the best way I think. Do not use wp_get_object_term() but use get_the_category()

  • Developing the site right now. I have 14 sidebar widgets, managed by Dynamic Widgets, and all is fine in Firefox, but nothing shows up at all in IE except the default Archives and Meta widgets…..

    What can I do? Don’t want to have to hard code all the widgets in by name—-I have DW disabled at the moment because the Client uses IE…

    eek.

    Thanks, Cici

    • Are you sure you did not add a browser conditional rule? Do the widgets appear when DW is deactivated or when no rules are applied at all? Are you sure all widgets are coded correctly because hiding an improperly coded widget can break eveything.

      DW does not hide and show widgets on the HTML level, but on the PHP level. That’s before rendering starts within the browser. So I’m sorry, but I don’t believe DW is responisble for breaking things in IE, except when it’s intended off course by using the browser rules.

  • I’m not sure if this is a newer version of this plug in, but now when I go into the admin of my site, I cannot go into each widget individually and check off the pages I do not want that want to show up on, so that when I make a new page all of the widgets are showing up and making the page very long, when I don’t need it to be & I need to shut some of them off.

    Under dynamic widgets, the first box (role) is set up in an automatic drop down with details, and all the other ones in the list are closed, and when I try to hit the arrow next to Pages, it turns the box white and the arrow turns down, but nothing opens up to show me all the pages of my site so I can deselect that pages I don’t want that widget to show up on.

    Please advise.

    • Apologies for the late reply Heather. I’m traveling at the moment, having limited internet access.
      It looks like the javascript accordion is crashing. Probably because of a javascript used by another plugin. I’ve seen it before happening with BuddyPress. Are you able to send me the source of the dynamic widgets admin page as an attachment to my email jacco at qurl.nl ? I can probably see which plugin is causing the problem. Please note it will take a while before I’m able to reply.

      • Thanks for getting back to me – “Are you able to send me the source of the dynamic widgets admin page as an attachment to my email jacco at qurl.nl ?”

        Where would I find this? I’m not very technically inclined. 🙂

        Or maybe I should be asking…what is the “source” of the dynamics widgets admin page.

      • Is there a way to revert to the older version of this plug in until we can troubleshoot the new one since there is a delay? It’s making all my new pages I add to the site include all of the widgets I have installed, so they are all very long, and it looks funny. Thanks –

        • The source of a webpage is the code behind the rendered page. Depending on the browser you are using. You can find an option in your browser menu called “View source”. Most of the time located in the “View” menu.

          Unfortunaltely when you installed version 1.4.0, it has upgraded the database. Therefor I can’t guarentee downgrading to an older version will work correctly.

          • Thanks, what is your email address – I can’t tell from the post above. I will try to locate that and email it to you. Thanks for your help.

          • It’s jacco(a)qurl.nl

  • Hi,

    I’v uploaded dynamic widgets on all three blogs. It works on humtank.com but not on the other two where I get the following message i red: Oops! Something went terrible wrong. Please reinstall Dynamic Widgets.

    The three blogs are almost identical; Twenty Ten, upgraded accordingly but different widgets.

    Thanks in advance!
    Kjell

    • When this message pops op, it means the database has not been found. Please reinstall Dynamic Widgets. A proper deactivate and activate of it should do the trick.

  • I’ve reinstalled the widget several times both within Wp and via FTP.

  • My 3 Wp-sites (humtank.com and tankekraft.net and insikter.nu) are placed in the same database. My web host asks if this widget works with a “unique key” and if the sites should be separated?
    I really want (need) the Dynamic Widgets to work!!!

  • Logic: 3 Wp-sites in the same database, Dynamic Widgets in one of them finds the database, and the other two doesn’t because the first one did?

    • Are you using the MU install of WordPress? DW does work, but only when you do an activation per site, not a network activation. See also FAQ 4.

      DW uses a separate table called [wp_prefix]_dynamic_widgets.

      • Three different databases solved the problem.

        • Ok, cool! Thanks for letting me know. 🙂

  • Dynamic Widgets made it possible to use WP for our website! We’ve been running it now for some weeks. Using some 45 widgets dynamically. Today when I went in to edit a widget’s dynamic’s, the edit page loads and ends without displaying all options, I get down to Attachments and that is all. End user functionality is still fine.

    I tried the OLD method, dev version, restarted apache/mysql. Tried clearing cookies, cache in browsers.

    • Please check the number of files in /wp-admin/plugins/dynamic-widgets/mods/ It should be 17.

      • 16 files. 1.4.0 tarball distro has 16 as well.

        archive_module.php
        attachment_module.php
        author_module.php
        bp_module.php
        category_module.php
        custompost_module.php
        date_module.php
        error_module.php
        frontpage_module.php
        pages_module.php
        role_module.php
        search_module.php
        single_module.php
        useragent_module.php
        wpec_module.php
        wpml_module.php

        • Sorry, noticed after I posted. No sure if its a typo, you listed /wp-admin/plugins … path, I posted the files from wp-content/plugins …

          I have nothing in /wp-admin along those lines.

  • I had switched back to the release version. The dev version has 17 files (adds tpl_module.php). I re installed the dev version and now have the 17 files. Still issues.

    I tried ‘reset’ on a dynamic widget then re-edit with same results. It did reset the widget to static properly. I am wp 3.1.3, Centos 5, php 5.2.10.

    • My mistake, it are indeed 16 files and made the typo, it should be wp-content.

      Is the accordion effect still working on the DW page? In other words, clicking one of the possibilities gives a sliding effect.

      • I’m not totally sure which page your referring too, so I’ll say this.

        Dynamic Widgets page – (wp-admin/themes.php?page=dynwid-config) everything is fine.

        Edit option for the widget – (wp-admin/themes.php?page=dynwid-config&action=edit&id=text-3) is the problem page. The items are expanded and never shrink back up. ‘Set all option to NO’ link is unresponsive. Roll, Date, Browser, Templates, Single Posts, Attachments are shown (nothing below attachments) and the radio & check buttons “work”.

        Otherwise, everything is functioning. On the user end of the site my sidebar blocks are displaying properly based on the dynamic rules I had in place before the edit page went goofy.

        • From apache error log.

          PHP Fatal error: Maximum execution time of 30 seconds exceeded in /xx/xx/wp-includes/post.php on line 1663, referer: http://xxxxx/wp-admin/themes.php?page=dynwid-config

          post.php is

          function sanitize_post_field($field, $value, $post_id, $context) {
          $int_fields = array(‘ID’, ‘post_parent’, ‘menu_order’);
          1663— if ( in_array($field, $int_fields) )
          $value = (int) $value;

          // Fields which contain arrays of ints.
          $array_int_fields = array( ‘ancestors’ );
          if ( in_array($field, $array_int_fields) ) {
          $value = array_map( ‘absint’, $value);
          return $value;
          }

          • Ah, that log was very helpfull! How many categories and pages do you have? I think the tree-buiding used for categories or pages is timing out.

  • 3 categories. 5 posts, and 230 pages. There will be more pages in the future, posts will stay around 10 or less, and categories the same.

    • I changed my php.ini timeout value from 30 sec to 60 and now the page is working. I’m assuming this is the nature of the beast given the number of pages I have.

      • While I get the full menu options now, I’ve had some problems getting settings I’ve done to save. Will do some more testing.

    • Yeah, 230 pages is quite a lot. I think I have to add an option to switch off the tree building. It’s now done automatic when there are more then 500 pages. But It looks like that limit is too wide.

      • Ok, I’m now running with value of 60 in php.ini for timeout which is giving enough time.

        I created another widget and that set ok, so I think the other widget that would not save correctly (after about 10 attempts it did save) was an oddity or corrupted item.

        I’ll continue to test and report back if there are more problems.

        If there is a way to limit the tree building to speed things up that is great, however as long as it works I’m happy. Once the widgets are created, it is seldom the option is needed to be used.

        And thanks for everyone’s attention. More proof for my bosses that open source DOES deliver on the software and support side! Thanks!

        • I’m going to have a look to see if it’s possible to speed up the tree-building and probably also adding a config option to switch it off. I’m back next week after my travels, so then I can look into this.

        • Just to let you know in the next (dev) version you’re able to set the limit yourself for the number of pages. Also a failsave has been added to the static pages module when a timeout occurs, it doesn’t stop all the other following modules to load.

  • I like this plugin but I can’t get it to work on my ‘News’ page which is set up as the posts page, on all other pages it works fine – if I change my News page to an ordinary page the plugin works fine.

    Also, it doesn’t work on category pages.

    I’ve followed the instructions but is there something else I can do?
    I’m running WordPress 3.1.3. The theme is Absolum.

    • Is the ‘News Page’ the front page? Cause then you have to use the ‘front page’ option in DW.
      Re the category pages: This might be something to do with the theme you are using. I have to check that out. Will be somewhere next week as I’m traveling right now and will be back home beginning of next week.

      • Thanks for the quick reply.
        No, the News page isn’t the front page.
        I’ll test out another theme to see if the problem is theme related.

        • Did you set a static page as the front page? In that case you will find both pages (when set correctly in WP settings) under static pages.

          • Yes, in the settings alongside ‘Front page displays’ I’ve selected the static page ‘Home’. Directly under that I’ve selected ‘News’ for the posts page — whatever page I set as the posts page does not display widgets.

            I still have to check with another theme, I will post later. Thanks for your help.

          • As I feared, the problems are theme-related. I temporarily set the theme to 2010 and the widgets do appear as wanted on the posts page, also on the category pages.

            My php skills aren’t good enough to work it out, I’ll check with the theme developers.
            Thanks for your help.

          • Ok, thanks for letting me know. 🙂

  • Hi there, I’m experiencing another strange issue with this plug in. I didn’t make any changes to this page http://youandimprovedcoaching.com/connect/book/ and all of the sudden of as today all of my widgets started showing up on the side of the page for some reason, when I had it set thru dynamic widgets from a few months ago to only have the top most widget there & that is the way the page had always looked. What would make all of those widgets just show up down the right hand side of the page, and how can I fix it? Thanks.

    • Is the configuration (aka the conditional rules) of the widgets in DW still ok?

      • I would assume so – I didn’t go in there and change anything, I wasn’t even in the admin panel & when I opened the page this AM, all of the widgets are showing up. I’m not sure though what you’re asking. I may have to pay our developer to figure this one out with you. I’m not good at this stuff unless it’s a fairly simply fix or html thing.

        • Please make sure you’re right. What I mean is you have set some configuration for widgets within DW to hide widgets. Please check if this configuration is still valid.

          • I can’t check that – see my earlier post above further up — the accordion feature on this plug in upgrade is not working in my admin panel since the new version came out, so I have no way of going into each page & selecting which widgets I want to show up now, or see what is selected. 🙁

          • Since I can’t check that, what do you suggest so I can fix this other issue? Thanks –

          • Ah yes, I forgot about that. Did you manage to save a page and send it to my email so I can check where it goes wrong?

  • Still running WP 3.1.4 (waiting for Arras fixes to upgrade).
    286 pages, 46 widgets.
    Dynamic Widgets 1.4.1
    php timeout 60

    So I know I’m pushing the envelope here. I see the page limit display, I think that was add-on to address the timeout issues.

    I’m seeing another issue, not sure if its related to my older WP version (will test my sandbox 3.2.1 at some point). With Dyn Widgets 1.4.1, the pages listed in the Page display have a mis-rendering in FF (I have not tested other browsers yet). The check boxes are just visible, and selectable. ie, they appear to be outside the left border of the scroll box.

    Also, before the page hierarchy would be shown, and I think there was a “all sub pages” tick option as well, which I don’t see anymore. I don’t know if its been removed or its part of the mis-rendering I’m seeing on my production site.

    • Oops. Forgot to mention. Some pages (not the pages that are the parent of child pages) are indented to the left, and their left most text & check box are outside the scroll box.

      Happy to supply screen shots if it helps.

      • Hi Kevin,
        Yes please, screenshots would be very helpfull! I have no idea (yet) what’s causing that problem.

        • is there an address I can email them?

  • I’m having trouble getting this to work for the children categories of selected parents in WPEC/WPSC. (I’m using wp e-commerce 3.8.4, i think).

    Here’s the deal: I have two sidebar menu widgets — one for “Modern” items, one for “Vintage” items. I want the Modern menu to only appear when people are browsing the products page for Modern items, and Vintage menu to only display when looking at Vintage items (on the products page.)

    The problem: Modern categories have a structure that looks like this:
    Modern Items
    -Seating
    -Accessories
    -Designers
    –Hans
    –Franco

    So, there are three categories descended under “Modern Items,” and one of the child categories has two children of it’s own (hans and franco!). I’d like to be able to instruct the menu widget to appear on all product pages that are nested under “Modern Items.” Right now, it will only show up at the top level.

    Am I doing something obviously wrong here? Thanks so much for your help. If this works it’d be way easier than figuring out Widget Logic!

    • First of all, no you’re not doing something wrong. In the WPEC module Dynamic Widegets does not inherit rules from parents like in static pages or categories. I think that’s actually where you’re looking for. DW should display a flat list of all the categories defined in WPEC. At that point you should be able to select all the categories. Anyway, I’m going to add inheritance for WPEC categories to the whishlist.

      • Crud. That’s what I was worried about. We’re going to be adding lots of new things under parent categories, so it won’t make much sense to go in and try to alter this every single time. Hope you get to it soon! It’d be a lot better than having to create my own function to call for Widget Logic.

        • Hi Jared, I’ve just uploaded development version 1.4.1.8 which has support for hierarchical inheritance within Custom Post Types and Custom Taxonomies. This is what I think you’re looking for. The WPSC Categories you see in 1.4.1 are removed from 1.4.1.8 as the “Categories (Products)” section has taken this over. Be sure to copy over the settings you have now at the “WPSC Categories” to “Custom Taxonomy Archives Categories” before you install 1.4.1.8.

          • This is amazing. You are amazing. Just plugged it in and it works great! Thanks so much for this. I’m off to the donate page right now.

          • Good stuff! Great to read everything is working. 🙂

  • Hi, I’m trying to get the plug in working on a WordPress 3.2.1 multi site. It’s throwing up the red “something went terribly wrong” box which I noticed elsewhere you said was because it couldn’t find the database.
    I’m also seeing the advice you’ve given on WPMU that you shouldn’t do a network activate but do each site individually.
    I can’t see how to do this on a 3.2 multiste, in order to be able to activate it on individual sites it has to first be network activated.
    Is there a way around this problem?

    • Correct me if I’m wrong, but I don’t think you need to do a Network Activation in the Network Admin. The individual sites dashboards should list Dynamic Widgets when you drop the dynamic-widgets directory into the /wp-admin/plugins/ directory.

      • No, Dynamic Widgets doesn’t show up on individual sites if you drop it into the /wp-admin/plugins/ directory of a multi site set up.
        You have to activate plugins on the root site of a multi site for it to appear in the plug ins of other sites.
        As far as I can see Dynamic Widgets doesn’t work in a WordPress multi site after WP3. Has anyone else worked out how to do this?

        • Hmm… I probably have to set up a fresh MU of WP 3.2.1 cause I see it in the individual sites. Also new plugins I drop into the /wp-content/plugins directory show up. Might be because I’ve upgraded to 3.2.1 recently from an old WP 3. Going to have a look into that…

  • I found a work around by using the plugin ‘Multisite Plugin Manager’ . This gives the ability to activate plugins on a site by site basis meaning that Dyanmic Widgets works fine. Thanks for your time.

    • Great! Thanks for sharing. 🙂

  • Hi,
    I am having difficulties with the “accordeon” in the admin. It doesn’t work anymore, I think now that I moved to 1.4.0.
    Would there be a (simple) way to make this admin page just expand all the options automatically if the accordeon cannot be fixed?
    I am using a theme called productfolio, btw.
    Cheers,
    Pascal.

    • Please use the latest version of Dynamic Widgets. Currently the stable version is 1.4.1.
      Is the accordion freezing? Are you using BuddyPress?

  • I upgraded to 1.4.1 and the accordion is still not working.
    I am using 3.2.1 and not using BuddyPress.

    • It’s probably another plugin bombing the accordion with it’s own addition of JavaScript. I’ve seen it before happening with BuddyPress (that’s why I asked that). Do you know how to save the Source code from a HTML page? I need the source of a DW edit screen. Than I can see which script is probably the troublemaker.

  • I can do that, no problem.
    Where do I need send it?

    • You can send it to jacco (a) qurl.nl