Putting 7.x's Advanced Search block on a separate page

89 views
Skip to first unread message

Peter Murray

unread,
Oct 29, 2013, 12:20:13 PM10/29/13
to islandora@googlegroups.com List
This is more of a Drupal question than an Islandora question I suspect, but I thought I’d start here.

The Islandora SOLR module provides a Advanced Search block. Such a block is great if I want to add it to a sidebar of every page, but I’d like to add an Advanced Search page where the markup of that block is in the main content area. Suggestions on how to accomplish this?


Peter
--
Peter Murray
Assistant Director, Technology Services Development
LYRASIS
Peter....@lyrasis.org
+1 678-235-2955
800.999.8558 x2955

David Wilcox

unread,
Oct 29, 2013, 12:22:29 PM10/29/13
to islandora
Hi Peter,

Forgive me if this is too simplistic, but could you just create basic page node and configure the advanced search block to appear in the content area of only that node?

David



--
You received this message because you are subscribed to the Google Groups "islandora" group.
To unsubscribe from this group and stop receiving emails from it, send an email to islandora+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Peter Murray

unread,
Oct 29, 2013, 2:09:44 PM10/29/13
to isla...@googlegroups.com
That occurred to me, too, but that isn’t something I can put in version control and replicate across a variety of instances (either in module code or as a Feature). (I guess I forgot to mention that as a desired attribute of any solution as well.)


Peter

Rosemary Le Faive

unread,
Oct 29, 2013, 10:44:24 PM10/29/13
to isla...@googlegroups.com
That's what I did. In my repo, I configured the block settings by hand, but because I'd rather not go through that again, here's how to do it in a module:

This gist works with my setup (D7; Islandora 7.x-1.2). Use hook_menu to define a path (here, the path is just 'advanced-search') and define a callback function that returns the block.  The trick in sorting through stack exchange posts, is to know whether you have to print() or explicitly call render() - but it seems that if you're in a page callback, you can return a render array and it gets displayed just fine. In Drupal 7. 

There might also be a way to programmatically set the block configuration (the 'display on only these pages' setting), either in PHP or Drush, but it's late, and I haven't looked into that.

Peter Murray

unread,
Oct 30, 2013, 8:28:49 AM10/30/13
to isla...@googlegroups.com
Ah, of course — that makes sense. Thanks, Rosemary!


Peter

On Oct 29, 2013, at 10:44 PM, Rosemary Le Faive <lef...@gmail.com> wrote:

> That's what I did. In my repo, I configured the block settings by hand, but because I'd rather not go through that again, here's how to do it in a module:
>
> This gist works with my setup (D7; Islandora 7.x-1.2). Use hook_menu to define a path (here, the path is just 'advanced-search') and define a callback function that returns the block. The trick in sorting through stack exchange posts, is to know whether you have to print() or explicitly call render() - but it seems that if you're in a page callback, you can return a render array and it gets displayed just fine. In Drupal 7.
>
> There might also be a way to programmatically set the block configuration (the 'display on only these pages' setting), either in PHP or Drush, but it's late, and I haven't looked into that.
>

Blake Carver

unread,
Jul 7, 2016, 11:27:44 PM7/7/16
to islandora
Yup, I'm replying to a 3 year old thread :-)

I have a question on how to theme this advanced-search page generated by this block. All my work with Drupal is below the theme so I'm rather clueless when it comes to themes.
I'm hoping to find a way to wrap a couple new div tags into this page, to put some text on the left side with an image, but everything I try fails. 
Can anyone point me in the right direction?

Creating an islandora-solr-advanced-search-form-wrapper.tpl.php does override everything, but then I can't seem to get the form to work, Drupal's form tokens just wouldn't line up. 

jes...@dltj.org

unread,
Jul 8, 2016, 6:40:21 PM7/8/16
to islandora

Hey, Blake,


I don't know about putting the <div>s on the page, but I found I was able to create some text in a sidebar by creating a new block and putting a limit on the pages where it lives:


 https://drive.google.com/a/chillco.com/file/d/0B6ChxLoL1bdhNERCdnc0ZWpMMms/view 


(In this case, I've used Rosemary's technique to create an advanced search page at https://blah.org/islandora/advanced-search so I set the block to limit to the page with the 'islandora/advanced-search' path.)



Peter

Blake Carver

unread,
Jul 11, 2016, 9:19:31 PM7/11/16
to islandora
Thanks Peter! That doesn't quite work for me, the block is too small to squeeze in the text.
Reply all
Reply to author
Forward
0 new messages