Multiple records on a page

11 views
Skip to first unread message

Owen

unread,
Nov 22, 2010, 9:48:09 AM11/22/10
to juice-project-discuss
Not sure if this is me being stupid, or just trying to do something
Juice not intended for. I've got a situation where I've got multiple
records on a page, and want to use Juice to enhance each item with
some additional information.

It looks like Juice only really handles a situation where there is a
single item in the page? Am I right about this? Any pointers or ideas?

Thanks,

Owen

Matt Machell

unread,
Nov 22, 2010, 11:08:33 AM11/22/10
to juice-proj...@googlegroups.com
Hi Owen,

It is a little different to single item pages, but can definitely be done.

Take a look at the way we handle multiple items on a Prism search
results page. One example would be the Syndetics Bookjackets extension
that Darren put together recently.

You can see that in action on
http://prism.talis.com/manchester-ac/items?query=data and
deconstructing that might help get a handle on how things can work.

Richard might have a more canonical example to work from?

-Matt

> --
> You received this message because you are subscribed to the Google Groups "juice-project-discuss" group.
> To post to this group, send email to juice-proj...@googlegroups.com.
> To unsubscribe from this group, send email to juice-project-di...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/juice-project-discuss?hl=en.
>
>

Owen

unread,
Nov 22, 2010, 12:10:30 PM11/22/10
to juice-project-discuss
Thanks Matt,

It looks like this is achieved by essentially having a list of ISBNs
scraped from the page into a single array (as metadef element), then
the Syndetics extension just reads them out one at a time and inserts
into the matching Juice insert. I can see how that can work I think -
but obviously a bit of a work around. If I've misinterpreted how this
works, ignore the next comments and help me understand!

I might copy this - it would probably work as an approach for what I'm
trying to do in this instance - but it's a shame that this means I
can't just throw additional extensions into the page (e.g. link to
worldcat) without writing an additional worldcat extension that knows
about my special array of ISBNs etc. This was one of the factors
behind looking at Juice - the idea that once I'd got a metadef we
could reuse the existing extensions as well as anything new.

What I've been thinking about is the ability to set a jQuery selector
context before running aspects of juice - so that all subsequent
selectors etc. work from within that context.

So - if you have a list of items each wrapped in a <li> (for
simplicity), you could first set a context by selecting <li>, do stuff
like metadef scraping and inserts in that context, then iterate over
each <li> to do this several times over. Of course the default context
would be the whole doc, so that you could continue using exactly as
currently.

Does this make sense? I've got something of this nature working for
the metadef bit, but I'm struggling for the inserts - although the
syndetics code might help here - I'll have a bit more of a play then
post back. Anyway, if you are looking at options for future
developments of Juice, there's my idea!

Owen
Reply all
Reply to author
Forward
0 new messages