Some articles are very long and getting cut off when saved to the database.
Is it possible to define a 'richtext' fieldtype as 'MEDIUMTEXT', or would I have to write a plugin to replicate the 'richtext' fieldtype with a different field attribute defined in defineContentAttribute
? Any other considerations to take into account? Such as search, indexing, redactor or otherwise?
Part 2 of this question would be: what is the simplest way to duplicate the RichTextField in a plugin? Can I just extend 'RichTextFieldType' and redefine getName
and defineContentAttribute
? I tried the following with no luck.
Update: This creates a 'Rich Text (Medium)' field with the correct DB column type of 'MEDIUMTEXT', but causes the 'Edit Entry' screen in the CP to be blank below the entry title (silent fail?); and if switching to entry type with this field getting a garnish error 'Double-instantiating a transparent text input on an element'.
class LongTextFields_MediumRichTextFieldType extends RichTextFieldType
{
public function getName()
{
return Craft::t('Rich Text (Medium)');
}
public function defineContentAttribute()
{
return array(AttributeType::String, 'column' => ColumnType::MediumText);
}
}
Another option might be to just redefine the columntype manually in the database. Is there any chance this value will ever get overwritten? (i.e. upgrades, migrations, etc).