This project is read-only.

Exporting / Importing custom content type

Topics: Writing modules
Jan 6, 2015 at 5:27 PM

I have some custom content types that I need to be able to import and export. All these types are created from modules.

Most of them didn't have a problem at all because I used custom database columns. I found a solution for exporting them here, and it works perfectly.

I have one that I created from the migration, and added a text field and a boolean field using WithField().

My problem is that when I export, only the metadata gets exported, not the data.

My migration looks like this:
public int Create()
             SchemaBuilder.CreateTable("TopDealBundleRecord", table => table

                "TopDealBundle", builder => builder
                    .WithField("BundleID", f => f.OfType(typeof(TextField).Name)
                        .WithDisplayName("Bundle ID"))
                    .WithField("MobileOnly", f => f.OfType(typeof(BooleanField).Name)
                        .WithDisplayName("Mobile only?"))

            ContentDefinitionManager.AlterTypeDefinition("TopDealBundle", cfg => cfg

            return 1;
And my Model is basically empty (I'm sure I'm missing something here, but I don't know how to declare the TextField, and how to get and set it):
public class TopDealBundleRecord : ContentPartRecord

    public class TopDealBundle : ContentPart<TopDealBundle>
My driver doesn't have the Importing/Exporting methods yet, those are the ones I want to add somehow.

Thank you for the help in advance!
Jan 12, 2015 at 9:09 AM
Hi everyone,

I hope you're all doing well!

Would any of you be so kind and take a look at this question? A little nudge in the right direction would be very appreciated!

Thank you for taking the time!