Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-27 06:56:40

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

How do I add another textarea on the write page?

Hi!
I will love to know how and if its possible to add another textarea
at the bottom of the write page
by using a custom field please?
(down to the excerpt’s textarea)

Thanks :)

Last edited by THE BLUE DRAGON (2007-11-27 06:58:18)

Offline

#2 2007-11-27 07:44:05

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: How do I add another textarea on the write page?

It requires a hack to the source files that present the write pane but is possible – see this thread (it may be an older version but the principle is the same).


TXP Builders – finely-crafted code, design and txp

Offline

#3 2007-11-27 17:11:09

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Re: How do I add another textarea on the write page?

Thanks!
works fine now :)

Last edited by THE BLUE DRAGON (2007-11-27 17:33:12)

Offline

#4 2007-12-09 09:12:22

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Re: How do I add another textarea on the write page?

Hi again!
how, and can I make the new text-area of the this custom field to ‘convert line breaks’ please?

(I can add the HTML tag: <pre></pre> in the form,
but you know its not like the good ‘convert line breaks’ that textpattern do)

Offline

#5 2007-12-09 12:05:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How do I add another textarea on the write page?

By adding following to to textile_main_fields function in txp_article.php:

$incoming['custom_1'] = n12br(trim($incoming['custom_1']));

Cheers!

Offline

#6 2007-12-09 12:11:00

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How do I add another textarea on the write page?

I think it’s better to do that when outputting the custom_field on the website, because otherwise the <br /> will be html-escaped. Also this avoids hacking TXP core code, which makes it easier to upgrade, and it’s more space-efficient, which is important, because custom_fields are limited to 255 chars:

<txp:php>
  echo nl2br(trim(custom_field(array('name' => 'your_custom_field_name'))));
</txp:php>

Offline

#7 2007-12-09 12:17:03

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How do I add another textarea on the write page?

ruud,

THE BLUE DRAGON had changed his custom field from varchar255 to text. As you can see if you look closely to the forum.

Cheers!

Offline

#8 2007-12-09 13:39:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How do I add another textarea on the write page?

Still, I believe my solution is better, if only for being able to see normal newlines instead of <br /> tags in the custom field textarea when editing the article.

Btw, the code hack shown in that other thread (pointed out by Jacob) is missing htmlspecialchars() around $custom_7.

Offline

#9 2007-12-09 13:55:30

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How do I add another textarea on the write page?

if only for being able to see normal newlines instead of <br /> tags

Yep, that’s the good point in it.

htmlspecialchars() around $custom_7

So, THE BLUE DRAGON should corres his txp_article.php’s code – &amp; is better than & obviously.

Cheers!

Offline

#10 2007-12-09 20:20:56

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 619
Website

Re: How do I add another textarea on the write page?

great!
realy thank you Gocom & ruud !!! :)

now It’s much more comfortable to update, with no using “<br>” all the time ;)

Offline

Board footer

Powered by FluxBB