News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

moving search box

Started by pittu, April 12, 2015, 09:43:08 PM

Previous topic - Next topic

pittu

How to move the following code to top menu bar? (Should be floating on right side)

So it will ne Next to 'logout' if user logged in or next to 'Register' if not.

thnx.

<div class="news normaltext">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '</form>';


echo '
</div>

shadow82x

What theme are you using?
Colin B
Former Spammer, Customize, & Support Team Member

pittu


Pipke

Can you make a screenshot of where you exactly want the search box, maybe with some arrows pointing to it?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Antes

Index.template

Code (Find) Select
   echo '
         </div>
         <div class="news normaltext">
            <form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
               <input type="text" name="search" value="" class="input_text" />&nbsp;
               <input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
               <input type="hidden" name="advanced" value="0" />';

   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
               <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
   // If we're on a certain board, limit it to this board.
   elseif (!empty($context['current_board']))
      echo '
               <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

   echo '</form>';

Code (Replace) Select
   echo '
         </div>
         <div class="news normaltext">';


Code (Find) Select
    echo '
            </ul>
        </div>';
}

// Generate a strip of buttons.

Code (Replace) Select
            // Add the search!
            echo '
                <li id="search_menu">
                    <form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
                        <input type="text" name="search" value="" class="input_text" />&nbsp;
                        <input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
                        <input type="hidden" name="advanced" value="0" />';

                // Search within current topic?
                if (!empty($context['current_topic']))
                    echo '
                            <input type="hidden" name="topic" value="', $context['current_topic'], '" />';
                // If we're on a certain board, limit it to this board ;).
                elseif (!empty($context['current_board']))
                    echo '
                            <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

                echo '       
                    </form>
                </li>
            </ul>
        </div>';
}

// Generate a strip of buttons.


Index.css
Code (Add to End) Select
#search_menu {
    float: right;
}

pittu

Thanks Antes.

It is working.

Advertisement: