WordPress.org

Ready to get started?Download WordPress

Ideas

Conditionality for widgets

  1. msmeritt
    Member

    12345

    I would love to see a simple feature added whereby every single widget that's added can optionally have a condition applied to it so that the widget can appear in some places and not others.

    Some widgets make sense on home page, archive, single posts, pages, but not everywhere. Some people might want a logo to appear within a set of child pages belonging to one particular parent page, but nowhere else on the site.

    Naturally, there will be many cases where someone will want a widget everywhere, and that's why the conditionality should be optional -- don't specify any conditionality at all, and it's just like it always was, no extra work for the user, and the widget appears everywhere. But for those who do want the option, adding this simple function would open up a world of customization for widgets without requiring that any number of widgets themselves be further complicated.

    Posted: 7 years ago #
  2. captainhendry
    Member

    12345

    Currently I have separate header and sidebars for posts versus pages. This means I can't take advantage of the great sidebar widgets plugin. Adding conditionality would be a great improvement.

    Posted: 7 years ago #
  3. Mark
    Member

    12345

    This is already possible via the template system, and I think template logic like this is better left to the templates instead of adding an extra layer of configurability to the admin interface.

    The idea is akin to Drupal 'blocks' and in my experience, that particular Drupal feature is quite a good example of why mixing up template logic and admin interface isn't a good idea. It can get very confusing, especially because the templates usually host a lot of conditionals too.

    Posted: 7 years ago #
  4. Mark
    Member

    12345

    removed accidental duplicate posting

    Posted: 7 years ago #
  5. Dougal Campbell
    Member

    12345

    codeispoetry: what is being described here is *not* already possible.

    What's being proposed is a mechanism for widgets to be configured so that they automatically appear (or not) on certain page views. So one could say "The FOO widget should always appear in the sidebar, but the BAR widget will only appear on archive views, and the BAZ widget will only appear for single posts".

    Posted: 6 years ago #
  6. bryan868
    Member

    12345

    This is an excellent idea, and I hope it's implemented. This really opens up the widgets feature and it greatly needed.

    Posted: 6 years ago #
  7. alanft
    Member

    12345

    I have implemented this and have just requested hosting here. It should appear here soon:

    http://wordpress.org/extend/plugins/widget-logic/

    I have posted early code here

    http://jauntyalan.livejournal.com/25171.html

    Posted: 6 years ago #
  8. alanft
    Member

    12345

    plugin is up now :-)

    Posted: 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    100 Votes
  • Status

    This is plugin territory