Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I'm trying to get the allowd child node of a document.
Let's say I have a document Called "Homepage", and in his structure the user can create 3 doc types under it"A", "B", "C" .
How can i get those documents? (DocumentTypeAlias)
You could use the Content Type service in order to find a list allowed content types if you know the document type's alias. I haven't tested the following helper method but it should give you an idea as to how you can do it:
public class ContentTypeHelper
public IEnumerable<IContentType> GetAllowedContentTypes(string alias)
var retval = new List<IContentType>();
// Use the content type service to find
// the content type passed to the method
var contentTypeService = ApplicationContext.Current.Services.ContentTypeService;
var contentType = contentTypeService.GetContentType(alias);
if (contentType == null)
// If we have found the content type, loop through
// each of it's allowed content types and select
// the content type
ct => contentTypeService.GetContentType(ct.Id.Value)));
So in your instance, you could use the above method as follows:
var allowed = ContentTypeHelper.GetAllowedContentTypes("Homepage");
Hope that helps.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted