• Situation: Using the standard categories widget and a widget from a plugin that uses the same code as the post category widget on the same sidebar. The categories widget is set for the posts and in drop down mode. The widget supplied with the plugin set to drop down mode and displays product categories.

    Both widgets displayed in drop down mode will cause only one of the widgets to work. Either the categories widget will work and the custom widget will not work or vice versa. I believe this to be a JavaScript instance problem where there can only be one instance of the drop down format being allowed to be active at a time on the sidebar page.

    If this is in fact the case, it would be nice to have some admin control over the instance code and allow more than one instance of the similar widgets to run in drop down mode on the same side bar page.

    Or to have code in the core that allows whichever widget has the focus at the moment to run as coded. ie. If the custom widget from the plugin has the active focus, it would be allowed to proceed as coded. If the standard categories widget has the focus, it would be allowed to run.

    Maybe some kind of function with a wild card setting for the custom widget name and whatever name is used in code for the categories widget being the other switch.

    In other words a switch function allowing the active selected (clicked) widget control to run its code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • a widget from a plugin that uses the same code as the post category widget on the same sidebar

    what plugin aectly?
    where did you download it from?

    Thread Starter flyfisher842

    (@flyfisher842)

    The plugin is marketpress-wordpress ecommerce

    The widget is the product categories widget which displays the marketpress product categories in the same formats as the WordPress categories widget for posts. Drop down, show product counts, hierarchy
    categories widget drop down, show post count, hierarchy.

    I can duplicate the product widget display using the codex code for the categories widget as code in a text widget but using product_categories for the display instead of post categories. And the documentation for the shortcodes for the product categories widget reference the codex for the optional code.

    I have tested this issue on one production site and two different test sites with several different themes including 2010, 2014 and 2015 and the virtue theme. The same conflict shows up in all cases.

    Woo Commerce got around this issue by using an input and display operator special code which I looked at enough to see how they did it but don’t understand all the code. Their widget has no conflict with the WP categories widget.

    Hope this helps.

    Thread Starter flyfisher842

    (@flyfisher842)

    he plugin is marketpress-wordpress ecommerce downloaded from the WP repository. (Sorry I didn’t know the link would auto transfer to the MP widget page.

    The widget is the product categories widget which displays the marketpress product categories in the same formats as the WordPress categories widget for posts. Drop down, show product counts, hierarchy
    categories widget drop down, show post count, hierarchy.

    I can duplicate the product widget display using the codex code for the categories widget as code in a text widget but using product_categories for the display instead of post categories. And the documentation for the shortcodes for the product categories widget reference the codex for the optional code.

    I have tested this issue on one production site and two different test sites with several different themes including 2010, 2014 and 2015 and the virtue theme. The same conflict shows up in all cases.

    Woo Commerce got around this issue by using an input and display operator special code which I looked at enough to see how they did it but don’t understand all the code. Their widget has no conflict with the WP categories widget.

    Hope this helps.

    Thread Starter flyfisher842

    (@flyfisher842)

    Actually this is a known issue since version WP 3.0 and has been escalated to a bug report but not fixed so far in core. It is a JS instance problem of only one widget being allowed to run at a time. There are patches out that may fix this issue but here is an easy way.

    I got around it this way by creating a top level post category called Post Categories. then creating a menu with that as the main display and all the other categories as sub menu items. Displaying the menu in a menu area will give a drop down of the post categories in the correct hierarchy and does not conflict with the product categories widget on the same page since they are different functions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘category widget conflict’ is closed to new replies.