I have a product search view. I use the "exposed form in block" in order to have only the filters show on all pages and the results show on a separate page. I want to put my filters in the top bar. How would I embed the "exposed form in block"? I know how to embed a view but I cant figure how to embed the "exposed form in block." in the top bar (the nav). The biggest reason is because its not a region. So I cannot place the block in it from the structure>blocks. Ive tried moving my header region to be on top of the nav but this create issues also. I was thinking that maybe there is a way to print the "exposed form in block" in the page.tpl.php... is this possible? Or will I have to use a hook in the template.php? Or Can I redefine the nav bar as a region possibly?

  • 1
    @Bala please consider adding help center reference links to custom off-topic reasons like this. cojomojo, the full text of what is forbidden is: "Implementing a functionality, or a layout seen in a site, for which only a screenshot or a site URL is provided". If you can rephrase your question so it would not need a link in it to be readable, it may still be OK.
    – Mołot
    Commented Dec 12, 2013 at 8:24
  • 2
    I went ahead and rephrased the question and updated it in order to comply with the terms and make my question clearer
    – cbalos
    Commented Dec 12, 2013 at 9:01

1 Answer 1

  1. Views UI -> create a page view
  2. Set 'Exposed form in block' -> Yes
  3. Go to Structure -> Blocks
  4. Find the exposed filter block which you recently created and configure the Region and Visibility settings

EDIT: to specify a new region modify .info file and page.tpl.php file of you page: e.g. MY_THEME.info:

regions[top_bar] = TOP BAR


    <?php if($page['top_bar']): ?>
    <div class="header_top_bar">
      <?php print render($page['top_bar']); ?>
    <?php endif; ?>


or if you want to insert a block into template file here is an issue.

  • i didnt give enough detail the first time (I updated the question now), I cannot place the block in the top bar because its not a region.
    – cbalos
    Commented Dec 12, 2013 at 8:56
  • @cojomojo I updated my answer
    – xurshid29
    Commented Dec 12, 2013 at 9:11
  • aha this was what I was looking for. Thanks so much
    – cbalos
    Commented Dec 12, 2013 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.