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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

how can you have a HtmlEditorField in a table field


Go to End


7 Posts   4131 Views

Avatar
Nicolaas

Forum Moderator, 224 Posts

5 March 2008 at 9:51am

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

Forum Moderator, 801 Posts

11 March 2008 at 9:44pm

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

Forum Moderator, 224 Posts

11 March 2008 at 10:00pm

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

Avatar
Sam

Administrator, 690 Posts

18 April 2008 at 7:51am

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

Avatar
Ingo

Forum Moderator, 801 Posts

18 April 2008 at 8:52am

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

Community Member, 245 Posts

22 July 2008 at 7:29am

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

Forum Moderator, 224 Posts

22 July 2008 at 10:15am

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