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).

Comments

rdeboer’s picture

StatusFileSize
new3.48 KB

Patch 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.

rdeboer’s picture

StatusFileSize
new2.79 KB

And 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.

rdeboer’s picture

And 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.

  • Install and enable the patched version of Slidebox (attachment in above comment #2). No need to configure anything.
  • Create a Content view, say "Slidebox content". Configure it to output the nodes (just the titles is sufficient) that you'd like a slidebox to appear on. Use filters (e.g. taxonomy terms), if you wish. Sorting is also relevant: the "Read more" suggestion in the slidebox is the one that in the view comes immediately after the one showing. Order alphabetically or by modification date, restrict the view to the "5 best of".... go wild.
  • Next download and enable the Views Global Filter module, version 7.x-1.x-dev (until 7.x-1.0 comes out). This module will pump your view into Slidebox. On the Global Filter configuration page, open the "Advanced configuration" fieldset. Select the view you just created.
  • Press the first radio-button (i.e. let the API cycle the filter) and "Save configuration".

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...

Anonymous’s picture

Title: Patch with fixes and feature: allow other modules to plug in content selection & recommendation, eg. via View » [Slidebox] Allow other modules to plug in content selection & recommendation
Status: Patch (to be ported) » Needs review
StatusFileSize
new2.2 KB

I 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.

rdeboer’s picture

Hi 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

Anonymous’s picture

Sorry 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).

rdeboer’s picture

Hi 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

Anonymous’s picture

Status: Needs review » Fixed

Pushed to git

rdeboer’s picture

Yay!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Added description of hook_slidebox_data_alter(0