In the 2.x version, we have hook homebox to enable a page to live in code. It would be great to add additional hooks to process, display and save data defined by these hooks OR to override data generated by the homebox module itself.
I am writing a module to enable users to "Add RSS feeds" to their home box much like "Add Item", without changing any code in the homebox module. I can provide the UI for users to add RSS feeds by overrideing the homebox.tpl.php and having additional js in my custom module to do the dialogs. But, saving & presentation of the RSS feed cannot be done without changing the homebox code itself. Adding API's/hooks to homebox would help module developers, using homebox to develop widgets easily.
Comments
Comment #1
mstef CreditAttribution: mstef commentedThat's a very excellent point. Why don't you take some time, and document for me, what you think should be in there, from another developers perspective. I'd love to get this in there..
Comment #2
abrao CreditAttribution: abrao commentedWill do. Give me a few days to get back to you.
Comment #3
mstef CreditAttribution: mstef commentedNo problem. Thanks.
Comment #4
mstef CreditAttribution: mstef commentedAny thoughts yet?
Comment #5
mstef CreditAttribution: mstef commentedComment #6
nibo CreditAttribution: nibo commentedCould I suggest Feeds integration?
I don't have any idea if that is possible at all, but it would be very powerful. It would support not only the import of RSS Feeds, but also iCal and CSV. So let's say I have the iCal Feed of some company I'm currently working with, but I don't want to to import all their events to my calendar, just want to have a seperate homebox block, where I could track their events. This could be one use case ...
Comment #7
mstef CreditAttribution: mstef commentedFeeds integration would be a separate feature request. I'm assuming that you can produce blocks/views that contain the data from Feeds. If that's the case, you can simply add the block to a Homebox.
Comment #8
nibo CreditAttribution: nibo commentedHey Mike,
yes, that can be done, but it would be possible only for the admin, or am I missing something? My idea was more from a user perspective. As addition to the cool widget adding functionality through "Add Item" right now the user could be able to select the type of the import from a drop-down list (Widget, RSS Feed, iCal Feed and so on) and if a feed is selected, then the content field would be the URL of the feed...
I don't know if it makes sense at all, it was just a spontaneous idea :) If it's silly just ignore it :)
Greets
Nikolay
Comment #9
mstef CreditAttribution: mstef commentedThat is interesting. I like the idea. But I think it should be the work of the Feeds maintainer to create a block or something that allows users to do that - as this seems like a good feature to have with or without Homebox. Have you tried making a feature request over there?
Comment #10
pheraph CreditAttribution: pheraph commentedHi,
I installed the Feeds-Module and used Views to create a block that accepts a node ID (to be precise the feed ID) and displays a list of the related feed items (that's no rocket science). Now if Homebox offered a dialog which allows to select a block and pass a parameter to it, the feed integration would basically be done. The advantage of this method would be that it is not limited to the Feeds-Module, through this interface other modules could be integrated with homebox. It shouldn't be too difficult to let the user select from a list of block and pass a parameter to it, should it?
Raphael
Comment #11
mstef CreditAttribution: mstef commentedHi,
Well again, this thread is about adding hooks to homebox - not Feeds. You should open up another issue if you want to discuss that. I'm not sure how hard it would be. It wouldn't be easy and quick - I know that. I've never even opened up the Feeds module. I can say though, that this is not something I'll be doing now. If you or another developer want to take a stab at it, I'd love to check out the work.
Comment #12
brianV CreditAttribution: brianV commentedBumping version as 6.x-2.x is no longer being developed.
Comment #13
Dustin@PI CreditAttribution: Dustin@PI commentedMy team created a module that does exactly what @runhrun suggested (i.e. a configurable rss homeblox block).
Using the current version of Homebox it's pretty easy to create a block with additional settings via "hook_homebox_block_edit_form"/"hook_homebox_block_keys".
I would say this was done ... except now I see a need to be able to set a default value for the keys in hook_homebox (i.e. so we can set the value that we want for homeboxes that are set on the page by default)
Example of what I am suggesting ...
Comment #14
Dustin@PI CreditAttribution: Dustin@PI commentedComment #15
Dustin@PI CreditAttribution: Dustin@PI commentedDid some digging to see if I could whip up a patch and it already works!
example
Comment #16
Dustin@PI CreditAttribution: Dustin@PI commentedSince the original request was a hook for doing something like "Add a feed" and various other extension points, I'm going to mark this back to postponed (maintainer needs more info).
I've created a separate issue #2074731: Document hook_homebox in homebox.api.php to update the documentation so that doing what I described above is easy to discover without having to read so deep into the code.
Comment #17
Dustin@PI CreditAttribution: Dustin@PI commentedBack to original request (adding additional hooks for developers) it would be useful if there was a hook for tinkering with (altering) the initial settings for a user. This could be useful in a number of scenarios: adding different default blocks by role or by person taxonomy.
It would be something like "hook_homebox_initial_user_settings_alter". I'm not sure if this actually should be an alter ... but it seems to be the easiest. Proto-type below ...
Comment #18
cockers CreditAttribution: cockers commented@ Dustin@PI - is that RSS block you discussed going to be added to a development version of the module? That's exactly what I'm looking for at the moment. I'd appreciate any help with that as my programming skills are very limited and that sounds like the kind of thing I'm looking for. Thanks for the hard work!
Comment #19
Dustin@PI CreditAttribution: Dustin@PI commented@cockers, I can split out the code and post it as a sandbox project. After that the Homebox maintainers can decide if they want to pull it in as as a sub-module.
It currently has a bunch of code that is specific to my site, so it will take a small amount of tweaks. When would you be looking to use it?
Comment #20
cockers CreditAttribution: cockers commentedThat sounds great. I'm definitely up for testing it - my site is still very much developmental so I'm in no rush so please don't feel as if you should be. That said, I can find time whenever it's available. Thanks again Dustin@PI, it's responses like that that make the Drupal community so great!
Comment #21
ptsimard CreditAttribution: ptsimard commented@Dustin@PI it seems I have a very similar use case on my end. Both the RSS feed block and possibly additional hooks. Where are you in your development process, did you overcome all hurdles?
My organisation requires many features to be piped through a personalised homebox page so I can see the next few months of my life being spent on the homebox module and integration. Still learning how homebox works right now.
Comment #22
drummClosing due to lack of information.