WordPress.org

Ready to get started?Download WordPress

Forums

Widgets problem with specific customizations (13 posts)

  1. lhk
    Member
    Posted 8 years ago #

    Hi,

    I tried using widgets and find myself at a loss when customizing things.

    There's seemingly no way to e.g. exclude certain pages from "Pages", no way to order them, parents/children are not shown - the widgets simply accept a title and that's all.

    Same goes for categories or meta.

    Also, the style gets only applied to the second widget from top onwards, the first one has no style.

  2. mylagoon
    Member
    Posted 8 years ago #

    "There's seemingly no way to e.g. exclude certain pages from "Pages", no way to order them, parents/children are not shown - the widgets simply accept a title and that's all."

    Not an expert on widgets, but if you edit the .php block file of the particualr widget block you want to edit, in this case the pages block, you can edit stuff like removing certain pages by using template tags.

    http://codex.wordpress.org/Template_Tags

    "Also, the style gets only applied to the second widget from top onwards, the first one has no style."

    Again, no expert, but I'd imagine this is some bad coding on the themes behalf.

  3. lhk
    Member
    Posted 8 years ago #

    Hi,

    yes this seems to work.

    However...

    Can someone please explain to me what then is the advantage of using widgets as opposed to simply applying the code to the sidebar?

    With each I have to dig into a php source file, and whether I drag and drop a block or whether I c/p a block is the same amount of work. Whether I change a title in a popup window or in php code - again same amount of work. Whether I change code in a plugin php file or a theme php file - same amount of work.

    There has to be something I'm overlooking, else I don't see any advantage, in fact the sidebar changes are more centralized (I don't have to do stuff in different files).

  4. mylagoon
    Member
    Posted 8 years ago #

    Widgets are a good idea for 90%+ of WP bloggers out there because they allow you to edit your sidebar without tooling in PHP.

    WP Widgets are a new addition, so you have to give them time to mature. Much like when WP went from hacks in 1.2 and below, to Plugins in 1.5+.

    As more coders and theme designers adopt widgets, more plugin authors and the like will publish widgets. If you can't already, I'd imagine it won't be too long before you can easily drag the pages widget to your side bar, click edit, and untick the pages you don't want to show.

    Just give the technology time to grow, it's still a little baby.

  5. lhk
    Member
    Posted 8 years ago #

    Hi,

    well, if I have to edit a widget in the widgets php file, and can only change the title in the sidebar arrangement page, I see no difference, except adding a step to the editing process.

    And if my wish for specific customizations isn't identical with the one of the widget/theme author or changes over time, I have to dig into php anyway, que no? Same as with the sidebar now.

    I still fail to see any difference, as I don't see this fact changing, even with more development.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Can someone please explain to me what then is the advantage of using widgets as opposed to simply applying the code to the sidebar?

    Sure. Widgets are new. Until somebody makes a widget to fit your needs better, with more customization functionality, then there really is no difference.

    The idea, in the long run, is to make sidebars independant of the theme files. If you switched themes, then the sidebars would instantly migrate with you, no need for hacking the PHP again. Widgets also make it easy to reorder the sidebars, obviously.

    BTW, if you don't feel like digging into the PHP and just using your own PHP code instead, then might I recommend the ExecPHP widget?

    well, if I have to edit a widget in the widgets php file, and can only change the title in the sidebar arrangement page, I see no difference, except adding a step to the editing process.

    Well, you could have edited the widget to have a new customization option instead, and then released that widget to everybody, thus preventing duplication of work. In the end, I feel that all reasonable features that can be customized should probably be presented as customization options in the Widget options screen.

  7. lhk
    Member
    Posted 8 years ago #

    Hi Otto,

    .....The idea, in the long run, is to make sidebars independant of the theme files......

    That might indeed be an advantage to some. Myself I never had a problem simply c/p-ing code into a new theme's sidebar either.

    .........BTW, if you don't feel like digging into the PHP and just using your own PHP code instead, then might I recommend the ExecPHP widget?......

    That's running in circles in my book. If I replace PHP in the sidebar in the first place, I needn't hop thru loops to do the same with 3 more steps instead of simply changing it.

    ......Well, you could have edited the widget to have a new customization option instead, and then released that widget to everybody, thus preventing duplication of work.........

    I usually find myself seeking quite uncommon and mostly not much sought after customizations. That's why I have trouble wrapping my brain around this whole thing in the first place. I usually go for "less" and "economical" not for "more" and "technical", which isn't really popular these days. ;-)

    I - also using quite a few non-blog CMS in my work - can see where this widgets idea comes from. I just fail to see why it would benefit WP which already has a nice, easy and elegant way of dealing with this whole area. Actually I often - when working with blocks-oriented CMS - find myself wishing things were as easy and in a positive way plain as a WP sidebar.

    When I read the discussion with Ladydelaluna I decided to try widgets to see what it brings to me, to judge for myself and couldn't - as I wrote - even begin to understand the hype going on about them. I also happen to not understand where her problem with plugins derives from. As far as I see it, only a minimal number of plugins can be exclusive to the sidebar, most will be used independent from it.

    I guess - as per now - I simply fail to see anything exciting in something which does nothing but add editing steps so far and apart from being another method to do something is not really new new ;-).

  8. ladydelaluna
    Member
    Posted 8 years ago #

    i'm only going to say this, and nothing more: thank you, lhk, for taking the time to check it out yourself and make an "educated" decision. i think that's what everyone should do when given an option like this... and i appreciate (as i'm sure do many others who may have not tried them yet but are considering trying them out) your feedback on them... it's nice to know i'm not the only one! :)

  9. Mark (podz)
    Support Maven
    Posted 8 years ago #

    ...........

  10. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Hey, to each his own. If you don't like widgets, then don't use them. It's a plugin, not a requirement. :D

    That might indeed be an advantage to some. Myself I never had a problem simply c/p-ing code into a new theme's sidebar either.

    When I changed themes, I had a hell of a time migrating my sidebars. Not because it was difficult, but because the format the sidebars used in my old theme didn't really jive with the new theme. It used div's instead of ul/li's, for example, and I had to spend a couple hours finding and changing minor things to make the new theme look right. It was not difficult by any means, but it was a bit time consuming. The block layout makes more sense in the particular case of sidebars, IMO. But again, to each his own. :)

    That's running in circles in my book. If I replace PHP in the sidebar in the first place, I needn't hop thru loops to do the same with 3 more steps instead of simply changing it.

    Yes, I agree that the ExecPHP widget is a roundabout way of doing things, but nevertheless it offers a couple of things that I found helpful (which is why I wrote it). It let me a) rapidly migrate my old sidebar blocks into widgets, and b) move them around as blocks and thus get the easy reordering functionality. However, I only recommend using ExecPHP as a temporary solution. Since I initially started using widgets, I've slowly replaced the 7 ExecPHP blocks I was using with widgets that better fit my purposes and which aren't as roundabout.

    Actually I often - when working with blocks-oriented CMS - find myself wishing things were as easy and in a positive way plain as a WP sidebar.

    I think it's a matter of difference in perspective. A quick glance at these forums finds lots of people having difficulties in some rather simple editing of PHP files. Lots of people are not used to thinking in a programming mindset, and yes, hacking PHP templates is programming. Sure, it's simple to you and me, because we're used to editing text files and we understand things like "functions" and how the page is generated from the template. But then we're also less than 10% of the population. :)

  11. mylagoon
    Member
    Posted 8 years ago #

    @lhk It would seem to me that you are arguing that the new widget functionality of WP doesn't greatly benefit you. However, you havent said that it has made it worse for you.

    Sure, the shoe won't fit everyone. You said it best yourself:

    I usually find myself seeking quite uncommon and mostly not much sought after customizations.

    What you are looking for is uncommon. With the advent of widgets, if you need to create something new, you do it the same way as before, so it really isn't harder for you to achieve.

    If what you're looking for is common, than your life has just been made a hell of a lot easier.

    Your argument against widgets could be used against plugins too. If your desired customization is uncommon than there probably won't be a plugin made for it, and you'll have to "tool" in PHP too.

    Does this mean plugins are a bad idea? Hell no.

    So if you are the vast majority of bloggers who use WP, don't know PHP (as most don't), want to be able to change your theme, keep your sidebar, and change it, all without looking at code, I'd say you'd be pretty happy with the whole widgets idea.

    But I guess you'd have to think of how this change benefits the rest of users to figure that one out, rather than fighting it because the change isn't positive enough for yourself.

  12. lhk
    Member
    Posted 8 years ago #

    Hi again,

    @mylagoon:

    ....However, you havent said that it has made it worse for you.....

    Hmm, but I did. If I need 2 or 3 steps to change something, in different interfaces,things become more time consuming and cluttered (as opposed to easier and faster).

    ....With the advent of widgets, if you need to create something new, you do it the same way as before, so it really isn't harder for you to achieve.....

    Before, without widgets, if I wanted to change/add to the sidebar, I went into the theme customization dialogue, chose the sidebar editing and edited.

    With widgets, if I want to change/add something, I first need to create the relevant widget (or customize one already in the php file) and save this in the widgets php file. Then I need to go into the sidebar dialogue and manually add (and probably also further customize) the sidebar element.

    Actually this is quite a few more steps than simply changing/adding to the sidebar, thus takes more time and thought.

    ....So if you are the vast majority of bloggers who use WP, don't know PHP (as most don't), want to be able to change your theme, keep your sidebar, and change it, all without looking at code, I'd say you'd be pretty happy with the whole widgets idea.....

    Only if you use widgets as they come out from the box.

    Let me tell you something from the vantage point of a webmaster who in the last 4 years has created over 200 sites for non-geeks, even practical computer illiterates, often speaking no English to boot: widgets are more complicated for them, not easier. I just might (and that's a huge MAYBE) teach those to d&d a widget into the sidebar, if that person is extremely interested in learning how to do that. But I'd have one hell of a time teaching this person to write (or even just to c/p) the convoluted code inside the huge php file which is the widgets base php.

    I however successfully taught quite a few of them to edit the sidebar. It's a short file, has a clearcut architecture with a syntax you can easily jot down and explain to people if you give them a multicolored version.

    The widgets file is nothing like that. Hell, it took me quite a long while to figure out what is what in there and where it is. It's LARGE and LONG and it has REPEATING code (if you scan it from a layperson's POV) which actually isn't repeating, it just looks as if.

    Thus, anything but out of the box is in my book now at least ten times as difficult for someone "not into programming".

    I dunno whether you know e.g. Joomla/Mambo, which has a similar system, which got completely out of the hand when the coders of Joomla/Mambo's "boxes" realized they needed to offer *every* possibility of customization to them. You can do that now, sure, but customizing a box content and it's display now is almost a science of its own and it's a major affair. The only small point which still is easy, is shoving it around the template, but even then, if you haven't added the placeholder and activated it for that part of the template the boxes won't show. The whole thing now is far past a layman's abilities and it's neither simple, nor elegant, nor easy.

    As you yourself point out, it's no major obstacle to people like you and me. But one reason I chose WP for many client sites is it's simplicity and the fact that I can easily explain it to them. If someone is of so little coding/computering knowledge that he wouldn't be able to customize anything anyway, it's me the webmaster who sets up (and I don't need something like widgets), if someone has "some" knowledge and wants to apply it, I tend to favor the simpler system, instead of making him delve into a huge practically unstructured php file.

    And if widgets are written so encompassingly that all possible configs are added, the files will become enormously large (just think of all that unnecessary code bloat this will mean), the customizing procedure will become a hurdle course to adjust what you even didn't think about until you have it as you want it.

    That's what I meant with "technical" vs. "economic". :-)

    And no, I'm not "trashing" widgets simply because I feel like that.

    I like WP however A LOT for it's simplicity and easiness (I use all major OSS and commercial blog softwares in my work, but way above all the rest prefer WP for small sites) and believe that founded criticism of something bound to complicate and bloat the system should be presented when it rises. Especially as WP has lately acquired a performance problem, when compared to former versions, which begins to set it back compared to other blog systems. I see widgets as a possibility for more of the same.

    Needs to be voiced, que no?

  13. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    But I'd have one hell of a time teaching this person to write (or even just to c/p) the convoluted code inside the huge php file which is the widgets base php.

    Ahh, I see some of your concern here.

    Widgets don't have to be in the widgets.php base file. They can be separate plugins. Small ones at that. Heck, I've written 5 or 6 of them already.

    Here's an example of a very, very basic widget I wrote: http://ottodestruct.com/blog/2006/04/27/coastr-widget/

    It reads a couple of feeds from coastr.com and displays them in a sidebar. Essentially it consists of two functions, one for the configuration panel of the widget and one for displaying the widget itself. If a widget had no configuration options, then that would be only one function.

    Yes, editing the widgets.php base file is a bit annoying. Editing a single widget that isn't one of the default ones is much less so, because it's usually very clear where the widget code is, as it's a separate plugin that you installed to get that widget.

    A somewhat more complex widget can be found here: http://ottodestruct.com/blog/2006/04/18/google-calendar-widget/

    That one offers some rather unusual customization options, because it takes date formats for displaying the date and for grouping events by elements of the dates, and so it's a bit more complex to configure. However, the PHP code itself is still very simple, more or less.

    My point is that for people not wanting to customize the widgets' actual code, installing them is a matter of installing that widget's plugin and then D&D the widget into their sidebar. The widget may, or may not, have config options directly on the widgets page itself that they can adjust. Yes, if they want more customization than the widget offers on it's config panel, then they'd have to delve into PHP to add those options, but then if that's the case for a lot of users, then there's a case to be made for adding that configurability to the config panel for the widget in the first place, no?

    As far as installing something for the layperson, look at the old way:
    -Install and activate plugin
    -Edit sidebar to use plugin functionality

    Vs the new way:
    -Install and activate widget plugin
    -Drop widget into sidebar, possibly configure it via simple interface

    Not really any more difficult, to my mind. Not unless you want the widget to do more than it offers. This is the same as with plugins, if you want the plugin to do more than it offers, you'd have to edit the plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags