• I’m not sure if this is the correct forum to post this in, but I can’t seem to find a more appropriate one.

    So here goes:
    I’m hoping for a way, either plugin or otherwise, to add/edit widgets directly from the page/post editing page. For me, it is a lot of extra work to create a widget that I want on a single page by going through the widgets menu. Basically, that’s because I want to create a unique style of widget for every page/post. I’ve done a cursory search of the plugins directory but nothing came up that I can see… but often the search is unfriendly to a searcher’s needs… so I thought I’d ask.

    Here’s some context:
    I run a travel agency and part of being a travel agent is giving customers information on destinations I offer. So, I post reviews of places, like hotels, on my website.

    On each review page or post (I use both) I’d want to display a widget that displays some statistics about each hotel, like a star rating, location, amenity icons etc. Most likely this would be the HTML or a rich-text editor widget.

    But the problem is this widget would be a unique widget for each page, and going to the existing widgets manager, creating a new widget, editing it, and then assigning it to a page is a lot of extra work.

    I’d love to find a way to add a “widget editor” box to the right column of the page editor that has a dropdown to choose the type of widget assigned to this particular page, and depending on what you choose in that dropdown the box editor changes (for example, whether it’s an HTML or menu widget etc.)

    Is this possible? Is there already a plugin out there that can do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • This sounds a lot like what Phase 2 of Gutenberg is.
    But most plugins that supply a widget also supply a shortcode, and if it’s a recently updated plugin it supplies a block. Widgets store their data in the options table. Shortcodes and blocks are actually in the post content (stored in the posts table).
    It seems like your usage would be best with a shortcode or block instead of a widget.

    Thread Starter KingDingbat

    (@kingdingbat)

    Thanks for your response.
    A shortcode would only allow me to insert a pre-made widget into a page. I would still need to go and make the widget in the existing widget manager section of WordPress. The other issue is that the more review pages/posts I have, the number of unique widgets in the “sidebar” location of the widget manager would just become enormous, and all of them would essentially be assigned to just one page/post.

    What I really need is just a way to make a unique widget that is associated with the page/post I’m writing in the same screen where I write the page/post. Besides the fact that it is cumbersome and overly complicated to manage ALL widgets from a seperate system altogether, (Meaning, the widget manager is elsewhere than the editor for the page they are associated with.) it would just be impossible to manage the content I’m trying to create that way. For example, say I review 100 hotels or destinations. That would mean I would have 100 unique widgets cluttering up the widget manager under “Sidebar” and if I needed to edit one, I’d have to sift through all of it just to find that. I would be so much easier if the page/post editor screen just gave me widget management options for that page/post right there where everything else for that page/post is managed. I was just hoping someone had thought of this already and there may be a plugin for this sort of thing.

    As for Gutenberg, I’ll try it out again in the hopes that it’s improved, but when I tried it when it came out I became violent and angry and had to resolve to abandoning WordPress altogether if it were forced upon us. (I removed it via a plugin)

    A shortcode would only allow me to insert a pre-made widget into a page.

    This is not correct. Shortcodes are for this very purpose. They have parameters that you can set differently for each use of the shortcode and it has nothing to do with a widget. (no options are stored in the options table for shortcodes)

    The other issue is that the more review pages/posts I have, the number of unique widgets in the “sidebar”

    That’s why you should not use widgets per page. Widgets are stored in the options table, not the post.

    What I really need is just a way to make a unique widget that is associated with the page/post I’m writing in the same screen

    That’s why some plugins have made blocks out of their widgets and shortcodes. The whole point is that you shouldn’t use widgets for this.

    when I tried it when it came out I became violent and angry

    I agree, I don’t use it myself. But I don’t think that widgets is the correct way to put unique dynamic content into each post. That’s what a shortcode is for. But the new editor also has core widgets as blocks, a shortcode block, and I’m not sure if the generic widget block is released yet. The widget block is more recent, so it’s part of Phase 2. The other part of Phase 2 is redoing the widget screen so that all blocks are handled there. (This Phase 2 stuff is where I will exit. I don’t want my WordPress to have any blocks, so ClassicPress is looking better and better.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible to add widget from page/post editor?’ is closed to new replies.