Hi,
I really like this little module, but found it rather "closed" in that other modules cannot augment the content Slidebox selects and recommends to "Read more". I would like to use a View to determine this. I will post this in a follow-up.
Apart from incorporating a couple of earlier patches to posted to this queue, the patch in comment #1 simply adds a hook:
hook_slidebox_data_alter(&$node_details, $view_mode)
This allows other modules to alter the $node_details (nid and title) if they wish, or to return FALSE, if they decide that the node in question should not appear with a slidebox. They can also decide to introduce a slidebox on a node that the Slidebox module initially didn't put one on.
For now please consider the patch below, which fixes a bug in slidebox.tpl.php and also incorporates earlier patches from #1029972: Making invalid call to node and #1030810: Remove console.log left in slidebox.js (but not #1372266: Slidebox should still show some 'open-able' content when hidden).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | allow-module-modification-1388002-4.patch | 2.2 KB | Anonymous (not verified) |
| #2 | slidebox.tgz | 2.79 KB | rdeboer |
| #1 | third-party-interface-1388002-1.patch | 3.48 KB | rdeboer |
Comments
Comment #1
rdeboerPatch attached. Created against 7.x-1.x, which at the time of writing appeared to be functionally identical to the official release 7.x-1.1.
Comment #2
rdeboerAnd for those who want it handed on a silver plate, here's the resulting module, ready to use.
If you already have Slidebox installed, just copy it over the top of the existing folder. No need to run update.php.
Comment #3
rdeboerAnd here are the installation instructions for using a View to select content that is subject to having the slidebox appear and if it does what the next "Read more" should show.
Done. Visit a piece of content returned by your view, scroll to the bottom of the content and see the slidebox appear with its recommendation of the next related piece of content to read. Click "Read more..." etc...
Comment #4
Anonymous (not verified) commentedI wanted to get the outstanding bugs taken care of before tackling any new features.
That said, here's your patch redone against the current git.
Comment #5
rdeboerHi Brian,
Thanks for breathing new life in this cute module!
Just wanted to stress that the suggested extension is low-risk and "dormant" in that all it does is offer other modules a "hook". It doesn't alter existing behaviour in any way, but adds potential for other modules to take advantage of ("Views Global Filter" being a case in point, as demonstrated in #3 of this thread).
At a minimum please apply the one-line bug fix for slidebox.tpl.php that is part of the patch, at the bottom. It caused me and others grief.
Thanks again,
Rik
Comment #6
Anonymous (not verified) commentedSorry about missing the slidebox.tpl.php line. It's committed to git now.
As for the extension, I understand that it is low risk. However, I'm also looking at doing quite a bit more integration for more features like #1372234: Provide an easy way to enable a block to be output as a slidebox and #1372260: Let's make this more of an API and #1153274: Make Slidebox work properly with Panels and will probably start a 7.x-2.x branch for making this module much easier to integrate with different methods of site building in the next couple of weeks.
I reposted the patch to verify that the intended functionality was still complete (even though I'm pretty sure that it is).
Comment #7
rdeboerHi Brian,
Congratulations on the explosive growth of installs of SlideBox!
Maybe http://www.flink.com.au/tips-tricks/done-60-seconds-view-driven-slidebox had something to do with it, but I won't take that credit. Just joking.
Keep up the good work.
Rik
Comment #8
Anonymous (not verified) commentedPushed to git
Comment #9
rdeboerYay!
Comment #10.0
(not verified) commentedAdded description of hook_slidebox_data_alter(0