Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

how can you have a HtmlEditorField in a table field


Reply

7 Posts   3650 Views

Avatar
Nicolaas

5 March 2008 at 9:51am Forum Moderator, 213 Posts

Hi Folk

Is it possible to have an HtmlEditorField in a complex table field (that uses a pop-up to edit its data)?

I am also wondering if you can have an image field within a complex table field?

Basically, I want website users to upload images and the site admin to review the uploaded images in a complex table field.

Are there any examples?

Nicolaas

Avatar
Ingo

11 March 2008 at 9:44pm Forum Moderator, 801 Posts

image upload through an ImageField should work in a CTF popup - there's a tutorial in the newest issue of the german PHP Magazine that does just that.

HTMLEditorField in CTF popup - don't go there, its a world of pain ;) seriously, there's too many optimizations specific to the main CMS UI to make this generically work on the popup.

Avatar
Nicolaas

11 March 2008 at 10:00pm Forum Moderator, 213 Posts

Thanks Ingo - would love to see the german tutorial....

Avatar
Sam

18 April 2008 at 7:51am Administrator, 685 Posts

If you just want to split line breaks, you can use a TextareaField, and put $FieldName.XML in your pop-up.

Avatar
Ingo

18 April 2008 at 8:52am Forum Moderator, 801 Posts

Hey Nicolaas, we're allowed to make the PDF-tutorial available once the next publication of PHP Magazin hits the store (roughly mid may).

Avatar
Garrett

22 July 2008 at 7:29am Community Member, 245 Posts

Hi,

When you said, "If you just want to split line breaks, you can use a TextareaField, and put $FieldName.XML in your pop-up." What do you mean, "put" it?? What is the syntax?

Thanks,
Garrett

Avatar
Nicolaas

22 July 2008 at 10:15am Forum Moderator, 213 Posts

HI Garrett,

I think what Sam means is that you put:
new Textareafield("fieldname", "enter stuff here", $rows = 10, $cols = 40, fieldname.XML);

where fieldname.XML is the default value

In doing so, if there is data in the field already, before you start editing, it will show with line breaks.

see: http://api.silverstripe.com/__filesource/fsource_forms_fields-basic_sapphireformsTextareaField.php.html for information on the the textarea field.

I may be wrong though.

Hope it helps

Nicolaas