Switch Text to HTMLText on the fly

Assuming you have a model using plain scaffolding (like my simple team listing module for SilverStripe does) you can easily switch a $db field from Text to HTMLText in your config.yml, e.g.:

TeamMember:
  db:
    Description: HTMLText

You could also add new fields to a DataObject with that.

Running dev/build?flush we don't see anything (cause database doesn't need to change), but now we see automatically a HTMLEditorField scaffolded for this field.

Of course you cannot change order of the fields or do other fancy stuff withthis mehtod, but it's ok for simple, project specific changes.

Rate this post

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments