21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 267 Views |
-
HtmlEditorField Problem

15 March 2012 at 4:50am Last edited: 15 March 2012 4:59am
Hello
I have this problem :
I have created a HtmlEditorField (see code below)
The field is there accordin to database plumber but when I save some content in it the content just disapears and is not saved but i dont get any error it says 'saved'.Any idea ?
class ArtistePage extends Page
{static $has_one = array(
'ArtistePortrait' => 'Image',
'ArtisteBio'=> 'File',
'ArtistText' => 'HTMLText',
'ArtistePresse'=> 'File'
);static $many_many = array(
'Oeuvres' => 'Oeuvre'
);static $allowed_children = array(
'none' => 'none'
);
function getCMSFields()
{
$fields = parent::getCMSFields();
//Portrait Images
$fields->addFieldToTab("Root.Content.Portrait", new ImageField('ArtistePortrait', 'Portrait', Null, Null, Null, 'Uploads/Artiste_Portraits'));
$fields->addFieldToTab("Root.Content.ArtisteBio", new FileUploadField('ArtisteBio', 'UploadArtiste Bio'));
$fields->addFieldToTab("Root.Content.ArtistePresse", new FileUploadField('ArtistePresse', 'Upload Artiste Presse'));
$fields->addFieldToTab('Root.Content.Artist Texte', new HtmlEditorField('ArtistText'));
return $fields;
}
}Thanks
-
Re: HtmlEditorField Problem

15 March 2012 at 5:54am
Hi!
You’re mixing has_one relationships and db fields. Your ArtistText field should go into the $db array. Look at the tutorials and you’ll get it quickly.
Hope it helps,
Juan
| 267 Views | ||
|
Page:
1
|
Go to Top |

