Cannot copy content type through Import/Export

Oct 23, 2014 at 3:44 PM
When I export a content type and try to import it, I get these errors:

"AttributeSet already exists"
"Attribute already exists"

What I'm trying to do is copy a content type, then rename it so that I can set have different content types for different instances of the app. For example:

Widget App:
Content Type 1 - "Widgets"
Content Type 2 - "Blue Widgets"
Content Type 3 - "Red Widgets"

What is best practice for copying content types?
Coordinator
Oct 28, 2014 at 2:31 PM
The content-type has a GUID to identify it. If you really want another content-type, you'll have to give it a new guid before re-import.

But...I think you just want to add a field to differentiate the widget-type, so I wouldn't create a new content type for this.
Oct 31, 2014 at 9:40 PM
I want to be able to have different instances of the app on different pages, each instance with it's own set of content items. Right now, when I add the app to another page I get the same list of content items. This is a problem because I want to limit the type of content items available based on the page/instance of the app.

Does that make sense?

If I wanted to give it a new GUID, how would I do that?

Thanks for all the help!
Coordinator
Nov 1, 2014 at 1:32 PM
In this case your app is using the "wrong" way to access data.

Apparently your app retrieves "all" entities - maybe through App.Data["Widgets"] or something.

But you want "Entities of this module" - they way it usually works with content - and not all entities of Widgets.
This is very simple. Just configure the view to manage widgets (as content), and then use Data["Content"] - which only gives you the entities created in this module (or added manually).

Make sense? It's the same way content templates work...not the DB approach, but the content-way of doing things.
Nov 5, 2014 at 2:56 PM
2sicDev wrote:
Just configure the view to manage widgets (as content), and then use Data["Content"] - which only gives you the entities created in this module (or added manually).
Is this done in the template, or the module settings?
Nov 24, 2014 at 7:35 AM
Hi

You mention you want different instances of the app on different pages

what you can do is create your first widgets app

now export the content ( not the app ) go to the admin and click the import/export tab

now click "export (beta button)" now check everything content item and template.


Now create a new App and import the above created export file.

This imports the needed content and references to the templates ( but not the template itself)

in your newly created app just create 2 new templates ad copy of the content from the initial templates and edit them if needed.

This is the method i use

Armand
2DNN
Nov 25, 2014 at 1:03 PM
Thanks Armand, I will give that a try... I am assuming that this will create a new GUID for the imported content type?
Nov 25, 2014 at 1:08 PM
I dont know the exact detail but if you import the content as part of a new app it looks to work i never got errors or overlapping/duplicate content this way.
Coordinator
Nov 25, 2014 at 4:05 PM
@grayspace: Armands solution is corecct. the GUID is the main identifier for this content-type - and to be safe you should also give it a different name. So export, XML-Edit and re-import.