Hi Ryan,

Thanks for your answer!  I was not aware that ex:selection could do what I
wanted.  I found a way to use it to achieve the results.  I check with php
for the existence of the query string, and parse out the pubtype=book, and
then plug in the ex:selection="book" conditionally.

I did not get any errors in Firebug with that facet override code (
http://www.mail-archive.com/[email protected]/msg02799.html).  Yes,
the page is generated by php (it is the simile exhibit extension for
joomla), so that the example ended up on the page as syntactically correct
javascript.  Thanks for the tip on the click event.  I will try that if I
need it sometime.

Once again, thanks a lot.  Your patient and thorough reply saved me lots of
time and trouble. [?]

Regards,
Paul


On Fri, Jan 27, 2012 at 7:08 AM, Ryan Lee <[email protected]> wrote:

> Hello Paul,
>
> On 2012-01-26 13:13 , Paul Warner wrote:
> > Hello,
> >
> > I need to be able to preselect the book filter via the query string (
> > http://www.hucompute.org/publikationen?select=book, for example).  I
> have
> > tried the code here:
>
> Just to clarify, you mean your use case precludes using the built-in
> mechanism of pre-filtering, ex:selection?
>
> > http://www.mail-archive.com/[email protected]/msg02799.html . But
> it
> > just wipes out all my 4 facets, and leaves an empty page.  What I need is
> > for the query string value to trigger the book filter, as if it had been
> > clicked.  But if I do something like this, with jquery:
>
> It's a solution, but solutions that require you to duplicate code are
> fragile.  Nevertheless, that should have worked; did you watch your
> error console to see what went wrong?
>
> > $inlineScript = '$(window).load(function(){'
> > . '$("a:contains(\'book\')").trigger("click");'
> > . 'console.log("just clicked the bookFacet: ");'
> > . '});';
>
> I guess this is PHP?  My initial reaction was that this obviously
> wouldn't work because it isn't syntactically correct JavaScript - but I
> suppose your page is generated by PHP?
>
> > while I know I have the book link, nothing happens with the click event
> on
> > the link.  It is less than ideal, also, to have the whole set of
>
> The event listener isn't on the anchor element, it's on the parent
> element.  Try $("div[title='book']") as your selector instead.
> Presumably some setting concerning event propagation is preventing the
> child click from passing up to the parent.
>
> > publications load, and then to reload only the books.  If I could run the
> > scripts the first time with the right publication type facet filter, that
> > would be ideal.
>
> Assuming you mean load in the UI when you say "load", you would have to
> go in and do some deeper engineering to avoid going from the initial
> all-items state to the filtered state.  I suppose you could try to set
> ex:selection based on the query string before Exhibit runs through and
> processes the DOM.  A deeper solution may exist.
>
> Also, if you're using PHP, you could feasibly get the query parameter
> there and write out the value of ex:selection as you send the page; it's
> not a self-contained solution, but it would help achieve what you're
> aiming for.
>
> > Thanks for any help!
> >
> > Regards,
> > Paul
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/simile-widgets?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

<<330.gif>>

Reply via email to