You are here:  » Stylish Css search box

Support Forum



Stylish Css search box

Submitted by bodybuildingcom... on Mon, 2012-09-10 20:22 in

Hi David,

Thank you for answering the Header and Footer question for me.
I went and changed those.

At the moment I am not as familiar with PHP as I like, but I am
learning now.

Anyway, I want to add a stylish search box for the front page,
but I seem to run into problems with the search box in searchform.php.

I would like to add the following box from this page

He uses the following code:

    <form class="form-wrapper cf">
        <input type="text" placeholder="Search here..." required>
        <button type="submit">Search</button>
    </form>

Obviously, the large chunk of CSS code I can add, but I seem to have difficulty with the PHP
in the search box of price tapestry. It doesn't seem to come up properly.

Thanks.

Norbert

Submitted by support on Tue, 2012-09-11 09:47

Hi Norbert;

The only PHP considerations you need to make are the action attribute of the form tag, and the preset value of the search text box (which must also have name='q') based on your snippet work with something like;

    <form action='<?php print $config_baseHREF ?>search.php' class="form-wrapper cf">
        <input type="text" name='q' id='q' size='35' value='<?php print (isset($q)?$q:""); ?>' placeholder="Search here..." required>
        <button type="submit">Search</button>
    </form>

Cheers,
David.
--
PriceTapestry.com