Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-15 04:12:52

gravyface
Member
Registered: 2006-01-17
Posts: 12

How do you add CSS class to <txp:search_input /> ?

The wiki’s down right now so I’ll ask here: how do I add a class or id to the search_input tag? I’m looking in Presentation > Forms but I don’t see the search_input form (if this is what I’m indeed looking at). I checked the pocket reference and it seems that this tag has “size” and “wrapper” attributes but no class or id.

Thanks

Offline

#2 2007-04-15 05:17:12

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: How do you add CSS class to <txp:search_input /> ?

Here’s what I have on one of my sites:

/* Header - Search */
    #header #search {position:absolute; top:35px; right:20px;}
    #header #search form {position:relative;}
    #header #search #search-input-out {position:absolute; top:0; right:45px; width:155px; height:28px; margin:0; padding:0; border:0; background:url("../_templates/crystalx/images/search_input.gif") 0 0 no-repeat; font:bold 90%/100% "verdana",sans-serif; color:#192666;}
    #header #search #search-input {width:140px; margin:5px 8px; padding:3px 0; border:0; background:#FFF; font:bold 100%/100% "verdana",sans-serif; color:#192666;}
    #header #search #search-submit {position:absolute; top:0; right:0px;}
    #header #search fieldset {margin:0; padding:0; border:0;}
    #header #search fieldset {width:200px;}
    #header #search legend {display:none;}

Offline

#3 2007-04-15 13:51:30

gravyface
Member
Registered: 2006-01-17
Posts: 12

Re: How do you add CSS class to <txp:search_input /> ?

right, but how did you assign the id of “search-input” to the tag? When I view source on the rendered search input, there’s no class or ID assigned to it. There isn’t even one on the parent form.

Offline

#4 2007-04-15 15:49:14

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: How do you add CSS class to <txp:search_input /> ?

hi gravyface

For the search you can use the raw code (not advised if u are moving sites)

<form action="http://yoursite.com/" method="get"><input type="text" name="q" value="" size="15" /></p></form>

You can asign id or class wherever you like


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2007-04-15 18:14:21

gravyface
Member
Registered: 2006-01-17
Posts: 12

Re: How do you add CSS class to <txp:search_input /> ?

Ah ok. Thanks. Are they planning on adding class/id attributes to the tags in future versions? Seems like a common feature that’s surprisingly not there already.

Offline

Board footer

Powered by FluxBB