Share Content Types and Templates Across Portals (Not data)?

Jun 17, 2015 at 5:32 PM
I have a DNN install that has about 30 portals on it for different departments. I have created some content types and templates on my default portal. Is there a way I can easily have those templates and content types available for my 30 other portals?

My original thought was that I could export and import my content types/templates as an App. But when I imported them into a portal, it reverted the locations of my templates to Portals/0 instead of Portals/_default (I originally had them set to be in _default, the Host portal option). I would like that if I make a change to a template, I only have to edit it once, not 30 more times. Is that possible? Furthermore, it'd be great if I could just somehow give access to the other portals to use those content types, without having to export/import for each one.

I am not interested in having the actual entity content shared. So I'm not looking to create an entity, and have it be accessible to all of my other portals. I am only looking to have the templates and content types themselves available to the other portals.

Any guidance?
Jun 18, 2015 at 5:55 AM
So you have two wishes
  1. Sharing template-files across portals
  2. Sharing content-types across portals
Template sharing works, but I must admin that the import/export doesn't support that for security reasons. We wanted to make sure that nobody would publish Apps that would end up installing themselves in the _default folder.

Content-Types: There is an advanced, hidden mechanisms to share content-types. We use it all the time for the content-types which describe system-features, like the description of a string-field. Because it's currently reserved for system-types there is no UI to do this, but you could give it a try messing with the DB.

Basically it works as follows:
  1. You create a content-type in one system
  2. In another system, you create 1 single "ghost" record stating that this content-type is available there, but that it's definition comes from the main record
To see how this works, take a look at the AttributeSets table - and look at the @String content-type. You'll notice it has a main type for the default zone (probably 0 or something) and then lots of other @string-content-types, but these have 2-3 settings different and are then not configured at portal level.

Don't know if it will work and it's not an officially supported scenario, but it's a core functionality we use so we don't plan on changing it.
Jun 18, 2015 at 1:28 PM
The security thing makes perfect sense now. I didn't really think about that before.

I think for the content-type sharing, we might bite the bullet and just have someone install the apps per portal, then maybe do some database-magic to change all of their templates to use the ones in the _default folder.

It would be a fantastic feature to let Hosts manage installing Apps site-wide that would allow for content-type and template file sharing. Our clients tend to have larger DNN sites where they have 1 DNN install (in this particular case for a university, 3!) with multiple portals per install, and all portals have a similar look and feel.

Also, thank you so much for your reply. Every time I've posted about 2sxc, I've gotten a response, which I really appreciate.
Jun 18, 2015 at 3:25 PM
This was available in older version ( before there were apps )

we reused the content types all throughout our main and 30 child portals, only thing we needed to do fro each new portal was just copy over the template files to each new portal but that was it.

Later I added entities so you could also choose in what portals you wanted news to show or not

But so far we have not dared to upgrade because that feature is not in the new versions anymore
Jun 18, 2015 at 3:32 PM
BTW there are many ways to share content across portals. I guess what makes your question unique is the wish to share content-types, but not share the content.

Again it's technically there but meant for much deeper technical requirements, so in your case I would go for the lightweight export/import scenario of content types.

What do you think - would it be helpful to write some blogs about content-sharing across systems?
Jun 18, 2015 at 5:41 PM
Yes, our request (and I think the way nokiko is using 2SXC) is a bit different than sharing the content. I do remember in older versions, when you first installed the module, it asked you to create a virtual database or just use the _default one.

In regards to blog posts, I would love a rundown about how people are sharing actual content across portals. I have only done a basic setup where our authors create content on a main portal, then we just use angular templates + json feed to show it on other portals. I have not dug in too much to the newer features (visual query designer, webAPI) in the latest builds, though we are using v7.0.2 on this particular site. It does what we need it, minus that feature in my OP above that I would love to have :)