In the module for a custom ContentPart, how do I set a field to be a Text field?
In my migrations.cs class, I have created the table for the part:
public int UpdateFrom1()
{
SchemaBuilder.CreateTable("RightContentPartRecord", table =>
table.ContentPartRecord()
.Column<string>("Html"));
return 2;
}
So, I have a column called Html. I want to use the WYSIWYG editor, so I am told I need a Text field to get this to work “out of the box”.
However, this isn’t happening for me, so what do I need to do to turn my column called Html into a Text field on the part?
And how do I configure it to use the WYSIWYG editor?
A text field is not the same thing as a part property. Fields are not stored as their own database column. Here is an example of how you add a field to a part from a migration:
For text field, you’d also need to set the flavor setting by adding
.WithSetting("Flavor", "html")to the field builder.