Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Add Search Box to Page Menu (http://forum.bytesforall.com/showthread.php?t=977)

vinniev Mar 27, 2009 10:41 AM

Add Search Box to Page Menu
 
Hey Flynn, thanks for all the work you've put into this theme! Just registered today and I'll be donating shortly.

My first question has to do with adding the Search box within the Page Menu bar. How hard is that to do?

It would look similar to the designs below
http://s3.envato.com/files/94676.jpg

2nd question: I like the layout and look of the Page Menu Bars shown above. If I were to purchase them how replace the existing Page Menu Bars with the new design?

Thanks in advance....vinnie

Flynn Mar 27, 2009 07:02 PM

For the search box you'd have to edit bfa_header_config.php

Integrating those menus is possible but requires edits in various files, it is not a quick job

vinniev Apr 1, 2009 05:36 PM

Hi Flynn, I'm a little confused. Are you saying that I should edit the bfa_header_config.php in order to allow me to add the search box to the page bar?

Flynn Apr 2, 2009 05:12 AM

Yes, to include the search box into the menu bar, you'd have to edit bfa_header_config.php, plus add various CSS styles to make the search box align properly in all browsers. It would probably be easier to include a whole new menu bar, but if that menu bar is supposed to have a search box included, it would again be rather complex. This would easily take me 2-3 hrs

If you want include your own menu bar (one without search box), look for one that does not require any extra code such as <LI><span>Link</span></LI>

You'd need a menu that works with a plain standard unordered list

HTML Code:

<ul>
<li>...</li>
<li>...</li>
</ul>

Not all menus work like this. You'd have to look if "standard HTML UL list" is mentioned somewhere.

You'd have to include the CSS for the new menu either by including it as a separate file in header.php

PHP Code:

<link rel="stylesheet" href="<?php echo get_bloginfo('template_directory'); ?>/CSS-FOR-NEW-MENU.css" type="text/css" />

or by adding all the CSS as HTML/CSS Inserts -> CSS Inserts

Then you'd add the menu PHP code to header.php

PHP Code:

        <!-- Header -->
        <td id="header" colspan="<?php echo $cols?>">
YOUR MENU CODE HERE (above the header)      
        <?php bfa_header_config($bfa_ata['configure_header']); ?>
OR: YOUR MENU CODE HERE (below the header)
        </td>
        <!-- / Header -->

Your menu code would similar to this:

PHP Code:

<ul id="mynewmenu">
<?php wp_list_pages('title_li='); ?>
</ul>

So you'd end up with, i.e.:

PHP Code:

        <!-- Header -->
        <td id="header" colspan="<?php echo $cols?>">

        <?php bfa_header_config($bfa_ata['configure_header']); ?>

<ul id="mynewmenu">
<?php wp_list_pages('title_li='); ?>
</ul>

        </td>
        <!-- / Header -->

Then you'd turn off the Atahualpa menu bar at A. Theme Options -> Header -> Configure Header Area

rockoboy May 14, 2009 11:55 AM

Hello I am having a problem integrating the search box in the navigation menu.
I edited my bfa_header_congfig.php file and cannot get it to work.
The search box displays above and not within the navigation box and it is the whole width of the browser.
Have been pulling my hair out for 3 days.
This is what I have, any suggestions are welcome:

// Page Menu Bar
$page_menu_bar =
'<div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' . "\n";
if ($bfa_ata['home_page_menu_bar'] != '') {
$page_menu_bar .= '<li class="page_item';
if (function_exists('is_front_page')) {
if (is_front_page() OR is_home()) {
$page_menu_bar .= ' current_page_item';
}
} elseif (is_home()) {
$page_menu_bar .= ' current_page_item';
}
$page_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' .
$bfa_ata['home_page_menu_bar'] . '</a></li>' . "\n";
}
if ($bfa_ata['levels_page_menu_bar'] == "") {
$bfa_ata['levels_page_menu_bar'] = 0;
}
$page_menu_bar .= bfa_hor_pages($bfa_ata['sorting_page_menu_bar'], $bfa_ata['levels_page_menu_bar'],
$bfa_ata['titles_page_menu_bar'], $bfa_ata['exclude_page_menu_bar']);
$page_menu_bar .= '</ul></div>' . "\n"; ' <div><ul class="searchform">' .
include (TEMPLATEPATH . '/searchform.php');'</ul></div>' . "\n";
// END of Page Menu Bar

shuag May 15, 2009 11:45 AM

I was wondering the same thing. I wouldn't even mind if it wasn't in the header.

What I mean is having the page menu be smaller in width. This would allow for the search box to be put in on the right side without actually being inside of the page menu itself. This would allow the page menu and the search box to be on the same line. But still remain seperate.

I have looked around and can't seem to find out where the page menu width is located. I'm pretty sure it is in some php file somewhere though. Or maybe someone has a css insert that will work to make it even easier.

I don't think I want to try and put it inside of the page menu yet though. From what Flynn says it sounds pretty code intensive and I don't think I am a good 'coder' .. . .. . . yet.

SupraTT May 19, 2010 12:06 AM

I been trying to do the same thing using the following code:

Code:

        // Close table if centered
        if ( strpos($header_items,"%page-center") !== FALSE ) {
                $page_menu_bar .= '</ul></td></tr></table></div>' . "\n";
        } else {
                $page_menu_bar .= '<li style="float: right; margin: 5px 5px; width: 200px;">'.include (TEMPLATEPATH . '/searchform.php');'</li></ul></div>' . "\n";
        }

However, the search bar appears on top of the page and takes up the whole width. It appears tables/forms cannot be contained inside a list. Anyone have a suggestion?

I actually modified the searchform.php template to the following:

Code:

<form method="get" class="searchform" action="<?php bloginfo('url'); ?>/">

<input type="text" class="searchfield" value="<?php the_search_query(); ?>" name="s" />

</form>

and used the above bfa_header_config, but for some reason the .include (TEMPLATEPATH . '/searchform.php'); displays a "1" in the area where I want the search box to appear. Does anyone know why this is happening?

Thank you,

SupraTT


All times are GMT -6. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.