Is there a way I can have my search form in nav bar not collapsed when screen size decreases? I'm using bootstrap on Drupal 7
4
-
How do you render your search form? Is it a block assigned into a region? – Madelyn Cruz Jul 25 '17 at 2:41
-
If I understood you, I have a search form block in the navigation section and it's set in line with the main menu – axelmukwena Jul 25 '17 at 10:08
-
I see. Do you have page.tpl.php in your theme folder? – Madelyn Cruz Jul 25 '17 at 10:12
-
yes, and it's located at 'sites/all/themes/bootstrap_subtheme/templates/page.tpl.php' – axelmukwena Jul 25 '17 at 10:22
Add a comment
|
You can change your markup using the page.tpl.php
- Copy the
page.tpl.php
file from/bootstrap/templates/system
to your theme. - Edit the
page.tpl.php
that you've copied. - Move the line 108 - 110 below / above the
navbar-collapse collapse
div.
- Create a new div.
- Put the code from line 108 - 110 into the new div.
- Save
- The changes should be like the screenshot below.
- Flush cache
-
It worked, but the function disabled the collapse of both the main menu and search form. What I wanted was to disable the search form from collapsing, but the rest i.e main menu should collapse. Is that possible? – axelmukwena Jul 25 '17 at 10:55
-
I suspect that you have a multiple blocks assigned in navigation region. You might want to consider to create a new region. Edit your theme .info file. At the regions area starting from line 11, create a new region there eg. regions[navigation_right] = 'Navigation Right' Save. Move back the $page['navigation'] into its original placement. Render your new region Eg. $page['navigation_right']. Save. Flush cache. Move your search block into 'navigation_right' region. – Madelyn Cruz Jul 25 '17 at 11:03
-
Or you can check this link to see the samples on how to create new block region. drupal.org/node/1088718#comment-4194802 – Madelyn Cruz Jul 25 '17 at 11:05
-
Thank a lot @Madelyn, adding a new region worked perfectly and it'll be useful with a lot more I've been struggling with. – axelmukwena Jul 25 '17 at 11:49
-