Hi. I have a few Contentttypes in which I want to restrict what you can add in their ContentAssetFolder. (either blockdata or customdata implementing BasicContent).

Since the property used to be called AvailablePageTypes, I was hoping that AvailableContentTypes would work to filter what is creatable in ContentAssetFolder however it doesn't seem to work.

Ofcourse, I could implement my own ContentRepositoryDescriptorBase and ComponentDefinitionBase and have another tab with my content. However I have a few different ones and I don't want a new tab for each new contenttype I want to limit. So, how do I restrict which blocks I am allowed to add to a specific contenttypes ContentAssetFolder? (I know how to restrict a contentarea, but that isn't enough, I want to restrict creation types in contentassetfolder).

If it isn't possible right now, could I suggest AvailableContentTypes works for here as well and thus add that tab on blocks as well?

Dec 07, 2015 15:50

Currently the folder section of the Assets panel only supports creating ContentFolders.

I'd suggest that if you create a way to create specific content type inheriting from ContentFolder, you can set specific AllowedContentTypes on these instead. However you'll need a way to create instances for your own folder Content Types.

Check my blog post for some sample code: http://talk.alfnilsson.se/2015/12/07/creating-a-content-folder-that-only-allows-specific-content-types/.

Dec 07, 2015 22:49

Mjae, problem is I want this in contentassetfolder, not in contentfolders. Also there is a tiering problem since I have products(pages) that have features (custom data) which in turn can have characteristics (custom data). Tried haveing features implement contentfolder but didn't get that to work well. Secondly I tried modifying HierarchicalList widget to show all content as tree structure instead of only FolderTree like it is right now. However I sure ain't a dojo master so that isn't going very fast. Kinda want to usea copied and modified version of ContentTree (which is used for the pagetree) for CustomContentBase and then I could easily register the use of it in a Component and have childpages listed in left tree and childcontent(of type CustomContentBase) in a tree structure (with top node, current node picked in left sidetree) to the right.

Dec 08, 2015 12:43

Ok, I'm not all sure what results you're trying to do but I think I get the basics. I hope this gives you some clues.

I would not mess too much with the ContentAssetFolder itself with risks of things getting complex, however you could be able to apply my previous approach to that folder.

I've not tried this myself but since the ContentAssetFolder is a Content (inheriting from ContentFolder), you might be able to hook up to ContentCreated event and identify whether it's a ContentAssetFolder.

After that create a restricted folder structure in the ConentAssetFolder. It's only content after all.

How does that sound?

Edited, Dec 08, 2015 13:26

Problem is still, if I have multiple custom data which can cointain other custom data and for multiple reasons I don't want it in custom table using say entityframework, how do I represent this in a good way in episerver as custom data? Programatically it is very easy, using the edit mode, not so much.

Either I use Blocks, but then it gets messy and restricting gets complicated since I can't filter what can be put into contentassetfolder (well, event wise I can ofcourse).
Or I use IContent, but then it is still messy since using contentasssetfolder still has the issues with presentation. I can't get it to view nicely in a treestructure since they get added to assetfolders (if I use SharedBlock or HierarchicalList widgets).  Still teh ol block in block in block issue which get's messy.

I would like to have a configurable ContentTree (as in the pagetree) and use parent/child structure instead but not on pagedata, but rather on customClass:contentdata. So I could have one page in left page tree with page children and same node in right tree (on it's own tab there) with customClass children. Then it would be really easy to manage, order, create new and restrict what can be created where.

I guess this could be achieved by copying and modifying the contenttree widget and give it another datatype and then use that widget in a Component with something like:

	public class FeaturePaneNavigationComponent : ComponentDefinitionBase
		public FeaturePaneNavigationComponent() : base("custom-cms/widget/CustomContentTree")
			PlugInAreas = new[] { "/episerver/cms/assets/defaultgroup" };
			Categories = new[] { "cms", "content" };
			LanguagePath = "/components/feature";
			SortOrder = 11090;
			Settings.Add(new Setting("repositoryKey", FeaturePaneDescriptor.RepositoryKey));

So is this a bad idea? How else would I construct a reasonable editor not just for a singular customContentData object, but for a structure of it.

Edit: To clarify, I'm not interested in handling folders per say, but rather handling custom data. If the easiest way IS to set rights and use contentassetfolder then fine, but using contentfolders by themselves doesn't really match what I am after imho.
Edit2: I also see the question has kinda changed from my OP. gonna update the OP with a clarification.
Edit3: :( Can't edit op.

Edited, Dec 08, 2015 15:24

Hmm I how about you're using Blocks and Folders in the ContentAssetFolder for storing the data and as presentation use a Widget (see Ted's blog post http://tedgustaf.com/blog/2014/6/create-an-episerver-widget-for-edit-mode/). His example is aware of which content you're editing and can display the data.

Add a link for each row (or however you want to layout your information) so that the editor can go to that block for editing.

I guess it could really be solved by using Dojo magic, but that's unfortunately not my strongest suit either.

Dec 08, 2015 16:43

I'm actually leaning towards using blocks for now and build my own editor in view mode if in editmode. Create some actions that handles my customconent programatically (update, create and delete) and just list em editably on the page. would mess with the wswyg a bit, but I think I can live with that.

Dec 08, 2015 17:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.