Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-08 04:45:39

TheEric
Plugin Author
From: Wyoming
Registered: 2004-09-17
Posts: 566

taghandlers.php : remove hardcoded <br> tags

e.g., lines : 921, 1175 ( $out = (!empty($label)) ? $label.br.$out.$sub : $out.$sub; )

There really shouldn’t be style elements in the code, mmKay?

Offline

#2 2009-11-12 22:35:15

hal.subs
New Member
Registered: 2009-11-12
Posts: 4

Re: taghandlers.php : remove hardcoded <br> tags

Hi

I would really like to be able to remove the automatic <br> that is generated with this tag <txp:output_form form=“search_box” />

Can I please have the code or instructions to remove auto line breaks?
Thanks

Offline

#3 2009-11-12 22:47:47

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: taghandlers.php : remove hardcoded <br> tags

hal.subs wrote:

<txp:output_form form="search_box" />

If you have a tag like that, you should look inside your form ‘search_box’…

Offline

#4 2009-11-13 00:28:05

hal.subs
New Member
Registered: 2009-11-12
Posts: 4

Re: taghandlers.php : remove hardcoded <br> tags

Hi

Form code = <div id=“search-box-wrapper”> <txp:search_input wraptag=”“ /> </div>

<txp:search_input wraptag=”“ /> is standard search tag. How can I define it to remove the output <label><br><input>?

At the moment I have just removed it with the CSS using #search-box-wrapper br (display:none).

Does the trick but there must be a better way. The <br> tag is hardcoded.

Thanks

Offline

#5 2009-11-13 00:58:00

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: taghandlers.php : remove hardcoded <br> tags

How can I define it to remove the output <label><br><input>?

Sorry, had to remove my bullsh…

<txp:search_input label="" wraptag="" />

Last edited by uli (2009-11-13 01:04:47)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2009-11-13 02:05:54

hal.subs
New Member
Registered: 2009-11-12
Posts: 4

Re: taghandlers.php : remove hardcoded <br> tags

Hi
That removes the “label” entirely. I still want it to say “Search” but remove the auto line break that is generated.

Thanks for the response all the same.

Offline

#7 2009-11-13 09:48:13

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: taghandlers.php : remove hardcoded <br> tags

I really like to help but I don’t want to break you of thinking ;)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#8 2009-11-13 10:21:18

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: taghandlers.php : remove hardcoded <br> tags

Because at the moment the br is hardcoded, you have two options:

  1. modify taghandlers.php
  2. don’t use the search_input tag, but handcode the search box

BTW, this is the ‘Feature Ideas’ forum, for questions you’d better use How do I….

Offline

#9 2009-11-13 12:01:58

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: taghandlers.php : remove hardcoded <br> tags

Els wrote:

handcode the search box

That’s been my first guess (see “… my bullsh…”) until I saw that emptying the attribute values and deleting the button attribute could remove any unwanted elements. The br is apparently inserted as soon as you enter a value for label. Didn’t know that.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#10 2009-11-13 13:03:22

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: taghandlers.php : remove hardcoded <br> tags

uli wrote:

The br is apparently inserted as soon as you enter a value for label. Didn’t know that.

Neither did I. Still, if you want to keep the label, you’re stuck with the br. I just thought of a third option: use rah_replace to replace it with a space ;)

Offline

#11 2009-11-13 13:07:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: taghandlers.php : remove hardcoded <br> tags

fwiw I find the forced br a little annoying at times, especially when using the core’s ‘label’ feature in plugins. The alternative is to code the label stuff manually, but that adds bloat to plugins and using the core functionality is simpler (br notwithstanding).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2009-11-13 22:11:30

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: taghandlers.php : remove hardcoded <br> tags

Strange enough in this discussion: If you specify a label tag it is not even applied/output although the attribute’s name suggests so: The result is as if you write Search manually in front of a handcoded search form. (So this’d be obviously a valid fourth option ;)

I can’t tell when txp:search_input got its own form attribute, but as we have forms of type category and section now, shouldn’t there be one of type search for the sake of consistency?

I set up a second example in Textbook for showing the minimum of code required to build a customized search form. But neither is my coding waterproof nor is my English. Would someone be so kind and have a look if anything needs some sandpaper?
Thanks!

Last edited by uli (2009-11-13 22:12:30)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB