Version 1.x for WordPress 2.7 and below

Update: June 14, 2009

[Grouped Links Widget, version 2.x for WP 2.8+ is available here]

Grouped Links Widget can use any number of widget instances to group links by their associated link categories. This adds a bit more CMS functionality to WordPress.

If the blogroll is grouped into link categories and each category contains internal tag references, then you can flexibly group link categories and put these link groups into your sitebar(s). This, of course, works with traditional external links put in a blogroll too.

Here is a picture about how this works:

Using Grouped Links

Using Grouped Links Widget (Note: the second group is reverse sorted)

Initially the number of widget instances is limited to 8, but can be easily increased by editing the source code. However, in most cases 8 link groups (=widget instances) should be sufficient.

Each group of link categories can be sorted by name acending or decending. If simple sorting doesn’t fit to your desired order to appear in the sidebar, then create more than one link group and place them in the sidebar as you wish.

Grouped Links Widget is a simple widget, it mainly uses wp_list_bookmarks. If you want to add more functionality, don’t hesitate to modify the code😉

Download

Download of Version 1.0.3: grouped-links-widget.1.0.3.zip

Installation

  1. Unzip grouped-links-widget.zip inside the /wp-content/plugins/ directory; a sub-directory grouped-links-widget is created
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Choose the number of link groups via the ‘Manage / Grouped Links’ menu
  4. Place and configure your Grouped Links widgets via ‘Design / Widgets’ menu

Version History

[1.0.3] — Update for WP 2.7 compatibility

[1.0.2] — Fixes some HTML quirks

[1.0.1] — Fixes some decoration problems

[1.0] — Initial release

37 Responses to “Version 1.x for WordPress 2.7 and below”

  1. Thomas Says:

    … welche Website hast Du denn da als Beispiel angegeben ?

  2. baron Says:

    hi. Thanks for plugin

    perfect.

    Regards

  3. StefanMz Says:

    @Thomas: Das wird mal krisis.org, ich löse die alte Site mit Hilfe von WordPress ab. Dafür brauchte ich das Plugin.

  4. StevieD Says:

    I love this widget. I have been looking for one like this forever. Only one question. Is there anyway to get this widget to adopt the heading structure of the theme? What I mean is if I use this widget the category headings use a bullet point etc. My sidebar widgets by default adopt a heading in a box etc. Is there a way to get the widget to look like the other widget headings?

    Kind Regards

  5. StefanMz Says:

    @StevieD: I see two cases. First: Maybe the grouped links widget tags are not well prepared for the standard WP-CSS for sidebars. Second: If you use a special theme using own tag-decorations, then you have to adjust the CSS coming with the theme.

    Do you have an example page where I can have a look at?

  6. quarkiy Says:

    Ich habe dasselbe Problem wie StevieD. Ich nutze WordPress in der aktuellen Version 2.6.1 und das Theme freshy. Hier ein Foto der störenden Bulletpoints:

    “Menü” ist das normale Menü von WordPress, die zwei anderen Punkte mit BulletPoints sind Link-Groups, erzeugt mit deinem Widget. Habe schon alles probiert. Die einzige Datei, in der das codefragment “class=”linkcat”>” vorkommt, ist die deprecated.php, was für sich spricht🙂
    Wenn du den Link zur Homepage haben möchtest, schreibe mich bitte an. Ich möchte ihn momentan nicht publik machen.

  7. StefanMz Says:

    @quarkiy: Thanks for bug report and testing.

    @StevieD: new version 1.0.1 should fix your problem too — please try!

  8. StevieD Says:

    Stefan:
    Thanks for your response. Not knowing much about this stuff, But so you can see what I mean, if you go to my site http://www.realeuphoria.com you can see. My normal links are on the right hand side and I’ve loaded a sample of the widget at the bottom on the left sidebar. You can see from this that most widget headings incorporate the theme I use, however I’m not sure how this all works. Any thoughts would be greatly appreciated.

  9. StefanMz Says:

    @StevieD: Did you try version 1.0.1?

    The “Friends (Offline)” link group I find at the bottom of the left sidebar of your site does not use grouped link widget (I looked at the source code). Please try 1.0.1.

  10. StevieD Says:

    Hi Stefan;
    You have me really worried now because it is in fact the Grouped Links Widget on the left. If the source code is showing otherwise I’m at a loss. I’ve loaded a second grouped links widget underneath to check. I am running 1.0.1.

    Any thoughts would be appreciated.

  11. Cam Says:

    Great plugin – thanks.

    I am having a big problem with it at the moment though and I’m wondering if you have any idea of what may be happening? I had the plugin/widget up and running and working fine. I then needed a way to order the links within the link categories and so I installed the My Link Order plugin to do that. That didn’t seem to work with your plugin so I uninstalled it (the My Link plugin) but now all my widget categories built with your plugin have dissapeared and everytime I go to add them back, after I pressed save they dissapear again. Is there anything I can reset here? I’ve re-installed the plugin but it didn’t change things.

    Thanks for your help.

  12. StefanMz Says:

    StevieD, thanks for checking. I don’t know why the id’s for grouped links widget (I looked for) are removed, but anyway. Your theme uses h3 for the sidebar titles. So please try this: open grouped-links-widget.php; on both lines 44 and 45 replace “h2” with “h3”; that’s it, try again if this works.

  13. StevieD Says:

    Stefan, that has worked perfectly. Thanks so much. I will remember that for future updates. Thanks again.
    Stevie

  14. stefanmz Says:

    @Cam: This is a weird behavior you describe. Generally the plugins should not interfere, if they use their own namespaces to store their data. If you remove a plugin, then all stored own data (but not others) should be removed (some plugins prevent this by offering a special page to delete the data from the database). Grouped links widget works this way. — In short: I have no idea. I have to test the case you describe, but this will take time, because I’ll leave my computer for a longer trip.

    If you have access to the database you can check, whether there are yet some data left from “My Link Order”. Generally plugins store their data in table “wp_options”, search for “my_link_order” (or something like this) by column “option_name” and delete this entry (after uninstalling the “My Link Order”). — Be careful, this is only a remote tipp which is not tested!

  15. Cam Says:

    Thanks so much for your thoughts Stefan – greatly appreciated. Yes I though it may have something to do a with dirty entries in the database. After I posted here I checked the widgets back end in WP out again and it seems that no widgets can be added (they disappear after pressing the save button). I’ll look carefully in the database and see what I can see🙂

  16. greg Says:

    great plugin, it works great. thanks.

    it would be better to use the same style classes as are already used elsewhere, so that all the widgets have the sames style. a simple change does this: on line 44 of grouped-links-widget/grouped-links-widget.php, edit the style class of the H2 element from “title” to “widgettitle”. this worked for me and my theme and i bet it would work for most themes/widgets.

    @Cam and those who use the plugin my-link-order: i could not get this plugin to work under WP 2.6.2, and others are having trouble too. the problem seems to be that plugin itself not working with WP 2.6

  17. StefanMz Says:

    @greg: I can change “title” to “widgettitle”, no problem. Thanks for that idea.

    General hint for programmers: It is a good idea to become a bit familiar with the settings the wp_list_bookmarks function have: http://codex.wordpress.org/wp_list_bookmarks
    This function generates the grouped links (“bookmarks”), and using its params, the appearance can be influenced. In the grouped links widget source code this is done on lines 39-45.

    I wonder if having these params right into the widgets admin interface would make things easier or confusing.

  18. StevieD Says:

    Hi Stefan. I’ve had a problem with the last update. There was no formatting. However I did as you had me do previously and change h2 to h3 which fixed the headings however I now have dot points next to each heading and no background shading as with other widgets. You can check it out at my blog http://www.realeuphoria.com

    The widget has been great. Thanks.
    Stephan

  19. StefanMz Says:

    @StevieD: Argh, the source codes are so different!

    For you, uncommenting (deleting the #) the lines 32 and 48 in grouped-links-widget.php should fix the problem. I hope so, please try🙂

  20. StevieD Says:

    Stefan:
    That was great cause it gave me back my background. It hasn’t removed the bullet points though. I really appreciate your help in this.

    Kind Regards

  21. StefanMz Says:

    Stevie: Then finally remove the <li> and </li> at lines 41 and 42, so that only »… => ”,« is left over.

  22. StevieD Says:

    Thanks Stefan. It’s working. Sorry for the hassle but I love the plugin and will keep these handy hints for the future. Thanks again.

  23. G Says:

    Thank you for this wonderful code!

    How would i do to call the widget by adding a specific text from within a page (for cms pages are often used). Some plugins i have seen are using something like this:

    and that is what i’d like to do also, but i do not know how to do it with your widget. Can you help, please?

  24. stefanmz Says:

    @G: The comment field has eaten your link during saving😦 Could you give the url where I can look what you mean? Otherwise I don’t understand, what your idea is.

  25. G Says:

    Thanks for your answer, Stefan.

    Oops, sorrry. Yeah, the example code dissapeared from the comment!

    I still do not have my site up, since it not ready yet, only missing this blogroll feature now.

    I meant something that is called shortcuts

    Here’s a page that descibes what it is, and i could use that, because i can not use widgets.

    http://xavisys.com/2008/04/wordpress-25-shortcodes/

  26. stefanmz Says:

    @G: As far as I understand »shortcodes« they are a possiblity to call some function optionally with some attributes from a post content. Then the shortcode will be replaced by the returned result of the called function.

    Hm. I don’t understand, what these nice feature can have to do with Grouped Links Widget, because it is only used within the content of a post.

    And secondly, you are saying, that you can’t use widgets — but Grouped Links Widget is exactly that: a widget.

  27. Ulf Kister Says:

    Hi,

    since the plugin did not work as expected for me, I fixed it a little bit (maybe the syntax of wp_list_bookmarks() changed from 2.6 to 2.7, anyway now it does work correctly with WP 2.7):

    Line 40 ff:
    40 ### uk start tc
    41 ‘order’ => $cat_order,
    42 # ‘category_order’ => $cat_order,
    43 ### uk start tc

    Also I fixed a little typo – I think the correct spelling in the HTML-Form should be “aScending” and “deScending” instead of “acending” and decending” …

    Thank you for your work!

  28. StefanMz Says:

    @Ulf: Thanks for your effort checking the code! According to wp_list_bookmarks() there are both, the $category_order and the $order param. While $category_order is responsible for the order of the groups themselves, $order is used for the order of the links within each group. Thus both options address valid purposes. Feel free to use it your way🙂

    I like to make more options available for the user via admin interface, but I don’t have much time to implement it. It’s on my feature list…

    Last, thank you for the typo fixes!

  29. YB Says:

    Please make this available for the new version of WP… it’s exactly what i need and i can’t find a plugin making this now!

  30. stefanmz Says:

    @YB: Version 1.0.3 being compatible with WP 2.7.x is now available. Please check out and try.

  31. tm Says:

    This plugin seems to have the same problem I’m having on my blog… I can’t use get_bookmarks without it putting a before the title..

    links title

    <a href=”http://ar…….

  32. StefanMz Says:

    @tm: Your comment seems to be broken, I don’t understand what you mean. Could you repeat?

    If you what to explicitly write tags in the comment field here like <tag> you’d better write it like this: &lt;tag&gt;

  33. Angela Harms Says:

    Not sure what I’m missing, but I can’t figure out how to make more than one instance. Any ideas?

  34. Angela Harms Says:

    Of *course* I found it as soon as I asked.🙂

    For future visitors: it’s under “Tools.” Go figure.😛

  35. P. Jensen Says:

    Seems its not working in 2.8.

    I only get one widget after i put three in tools.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: