Page 1 of 1

Add Search box to header

Posted: Thu Sep 10, 2009 8:26 am
by ETR9
Hi guys, I'm wondering if somebody could help me figure out how I insert a search box (and button) to the lower right hand corner of my header. I'm under the impression that I need to create a new module position, but I do not know how to do that.

Any help is greatly appreciated. Thanks!

Re: Add Search box to header

Posted: Thu Sep 10, 2009 9:34 am
by OOmNezar
overlap it to top menu

Re: Add Search box to header

Posted: Thu Sep 10, 2009 9:41 am
by ETR9
wakjaer wrote:overlap it to top menu
But then the search box is at the top middle of my header, not the bottom right, like I want.

Re: Add Search box to header

Posted: Thu Sep 10, 2009 3:08 pm
by Alextampa
Open up your index.php
Paste this code (after changing the names to whatever you want. Where you would like the module to be. Most likely after <div id logo></div>
<div id="name-it-whatever"><jdoc:include type="modules" name="position-name" /></div>


Open Up templatedetails.xml (with notepad)

Paste this

<position>position-name</position>

Open up template.css
Paste this code, and change the position to wherever you need to it move to, and the height and width
div#YourDivName{height:15px;position:relative;right:0px;top:-3px;}

Re: Add Search box to header

Posted: Thu Sep 10, 2009 9:41 pm
by ETR9
Hmm, I opened up my index.php but was unable to find anywhere that I would insert the instructions. I could not find <div id logo></div>.

I should point out that I'm a relative newbie to this stuff, so I'm hoping you could be a bit more detailed in the description/instructions if possible :) . Thanks.

Re: Add Search box to header

Posted: Thu Sep 10, 2009 10:11 pm
by ETR9
When you say 'paste this code wherever you want the module to be' how do I know where the module will end up. I want it in the lower right hand corner of the header, but I do not know to translate that wish into putting it in the correct place in my index.php file.

This is one line I found in the file:

"wrapper_r">
<div id="header">
<div id="header_l">
<div id="header_r">
<a href=index.php><div id="logo"></div></a>
<jdoc:include type="modules" name="top" />
</div>


Where do you suggest I put:

<div id="name-it-whatever"><jdoc:include type="modules" name="position-name" /></div>

in order for my module to show in the right hand side of the header?

Re: Add Search box to header

Posted: Fri Sep 11, 2009 12:21 pm
by OOmNezar
BEFORE:
<div id="header">
<div id="header_l">
<div id="header_r">
<a href=index.php><div id="logo"></div></a>
<jdoc:include type="modules" name="top" />
</div>

AFTER:
<div id="header">
<div id="header_l">
<div id="header_r">
<a href=index.php><div id="logo"></div>
<div id="name-it-whatever">
<jdoc:include type="modules" name="position-name" /></div></a>
<jdoc:include type="modules" name="top" />
</div>

Re: Add Search box to header

Posted: Fri Sep 11, 2009 12:24 pm
by Alextampa
<div id="header">
<div id="header_l">
<div id="header_r">
<a href=index.php><div id="logo"></div></a>
<div id="name-it-whatever">
<jdoc:include type="modules" name="position-name" /></div></a>
<jdoc:include type="modules" name="top" />
</div>

This is correct.

Re: Add Search box to header

Posted: Tue Sep 15, 2009 4:15 pm
by nils99
thanks a lot!!!
great post, i finally know how to put in a new position, thanks alex!
:pop

Re: Add Search box to header

Posted: Tue Sep 22, 2009 4:13 am
by llit
Close to what I was considering, Is it possible to put it inline with the menu buttons in the top menu? I'm using a JS optimus free template.

I was wondering if it you could somehow tell a second module to publish inthe position top or something?

Re: Add Search box to header

Posted: Sun Sep 27, 2009 8:21 am
by crompton
Thanks for this post---very helpful!

Re: Add Search box to header

Posted: Sun Sep 27, 2009 6:37 pm
by Mahaj
ahh thanks its help in some ways

Re: Add Search box to header

Posted: Thu Oct 15, 2009 11:30 pm
by bigshoegames
Alextampa wrote:Open up your index.php
Paste this code (after changing the names to whatever you want. Where you would like the module to be. Most likely after <div id logo></div>
<div id="name-it-whatever"><jdoc:include type="modules" name="position-name" /></div>


Open Up templatedetails.xml (with notepad)

Paste this

<position>position-name</position>

Open up template.css
Paste this code, and change the position to wherever you need to it move to, and the height and width
div#YourDivName{height:15px;position:relative;right:0px;top:-3px;}
Thanks so much for this info--I was beginning to think it was rocket science and I wasn't going to cut it! I used your info to add a new module position in the upper right hand corner of the header of the milkyway template. I had searched and searched forums and got posts like: if you don't know css, html, and php, I can't tell ya how to do it. thanks for making it so simple!

Re: Add Search box to header

Posted: Sat Oct 24, 2009 7:55 am
by OOmNezar
Make sure to mark this discussion as SOLVED !!!!!

Re: Add Search box to header

Posted: Tue Jun 21, 2016 4:09 am
by Celinalim
The Joomla version I'm using is 1.5.25. I want to add a search button at the bottom right of my header but I can't find the index.php that was mentioned. Can anyone help :( :( :( :(

Re: Add Search box to header

Posted: Tue Jun 21, 2016 5:37 am
by Templatemesh
For example, if you want to create a position name called "search", you should add the following code into the index.php file where you want the search module to be displayed:

<?php if ($this->countModules('search')) : ?>
<div>
<jdoc:include type="modules" name="search" style="xhtml" />
</div>
<?php endif; ?>

Re: Add Search box to header

Posted: Tue Jun 21, 2016 5:42 am
by Shivika
Celinalim wrote:The Joomla version I'm using is 1.5.25. I want to add a search button at the bottom right of my header but I can't find the index.php that was mentioned. Can anyone help :( :( :( :(

you can find index.php file in /templates/your_template_name

Re: Add Search box to header

Posted: Tue Jun 21, 2016 8:06 am
by Celinalim
Shivika wrote:
Celinalim wrote:The Joomla version I'm using is 1.5.25. I want to add a search button at the bottom right of my header but I can't find the index.php that was mentioned. Can anyone help :( :( :( :(

you can find index.php file in /templates/your_template_name


Am quite new to this version so when I log in to the admin site I see: Dashboard, Menus,Sections, Categories, Articles and Modules. I can't find the "template" button or whichever place to go into the template section :'( :'( Could you guide me through? Thank you soooo much. Really appreciate it!

Re: Add Search box to header

Posted: Tue Jun 21, 2016 8:24 am
by Per Yngve Berg
Extensions->Templates

If you do not see it, your Joomla user does not have Super-admin permissions.

Re: Add Search box to header

Posted: Wed Jun 22, 2016 3:03 am
by Celinalim
So would it still be possible for me to add a searchbox at the header section? Joomla! 1.5 version. Is there any other way?

Re: Add Search box to header

Posted: Wed Jun 22, 2016 6:36 am
by Templatemesh
Video tutorial for adding top header 'Search' box in position 'search'. You may look at this https://www.[youtube].com/watch?v=Vhvgd57IJEg

Re: Add Search box to header

Posted: Sat Jul 16, 2016 5:07 am
by Templatemesh
Templatemesh wrote:Video tutorial for adding top header 'Search' box in position 'search'. You may look at this https://www.[[youtube]].com/watch?v=Vhvgd57IJEg
Please check tutorial url here