I dont think so, no. It's important to "map out" (either mentally or whatever) the structure and data types needed for a site running umbraco, as this can't really be changed.
I'm ready to be corrected though, it would have helped on a few occasions!
A smart way to change the default documenttmaster is to rightclick on the node in the contenttree, fx (blog), and choose "copy". THen choose the new location, and choose a documentmaster.
Afterwards you might need to do some trimming, but I have found this the only way to solve the problem.. and yes I have tried with "block for umbraco", and it works perfectly after this operation :)
The best solution, of course, would be if Umbraco actually allowed you to change the Master DocType via the existing interface. I've raised this as a feature request on Codeplex - it's the highest voted issue that still hasn't been resolved. Please vote for it if you want a change.
Better way would be backup the data in the content area and then export the documentType to UTD file. Then Delete the documentType import it back by right clicking root documentType. When importing select master document type.
I have used this query to put document types without a master under another master document type. It was build up by posts of other topics here.
USE WebsiteDB; -- Set with your DB name GO
DECLARE @ContentTypeId INT, @NewParentId INT; SET @ContentTypeId = 1058; -- set with ID of ContentType to change SET @NewParentId = 3114; -- set with ID of new parent to set to @ContentTypeId
-- Set new ParentID UPDATE [cmsContentType2ContentType] SET [parentContentTypeId] = @NewParentId WHERE [childContentTypeId] = @ContentTypeId;
-- Remove GroupID from properties that are in inherits groups UPDATE cmsPropertyType SET propertyTypeGroupId = NULL FROM cmsPropertyType INNER JOIN cmsPropertyTypeGroup ON cmsPropertyType.propertyTypeGroupId = cmsPropertyTypeGroup.id WHERE (cmsPropertyType.contentTypeId = @ContentTypeId) AND (cmsPropertyTypeGroup.parentGroupId IS NOT NULL);
-- Remove inherits groups DELETE TB1 FROM cmsPropertyTypeGroup TB1 WHERE (TB1.contenttypeNodeId = @ContentTypeId) AND (TB1.parentGroupId IS NOT NULL);
-- Reading path info DECLARE @NewParentPath VARCHAR(100); SELECT @NewParentPath = [path] FROM umbracoNode WHERE id = @NewParentId;
-- Update Path field UPDATE umbracoNode SET parentId = @NewParentId , [path] = @NewParentPath + ',' + CAST(id AS VARCHAR(20)) WHERE id = @ContentTypeId;
Insert into cmsContentType2ContentType Values(@NewParentId,@ContentTypeId)
GO
Afterwards I do a IIS restart and it's working fine.
Change Master Document Type after creation
Is it possible to set the Master Document Type of a Document Type after creation?
Only in the database: in tha table cmsContentType you can edit the column MasterContentType
Thomas
Forgot to say: You put in the nodeId from the ContentType you want as master
I dont think so, no. It's important to "map out" (either mentally or whatever) the structure and data types needed for a site running umbraco, as this can't really be changed.
I'm ready to be corrected though, it would have helped on a few occasions!
Dan
A smart way to change the default documenttmaster is to rightclick on the node in the contenttree, fx (blog), and choose "copy". THen choose the new location, and choose a documentmaster.
Afterwards you might need to do some trimming, but I have found this the only way to solve the problem.. and yes I have tried with "block for umbraco", and it works perfectly after this operation :)
Wow, 8 years later, Umbraco 7.7 and this tip STILL works and has saved me having to recreate a billion properties, thanks from the future Johan :)
Awesome tip Johan!
The best solution, of course, would be if Umbraco actually allowed you to change the Master DocType via the existing interface. I've raised this as a feature request on Codeplex - it's the highest voted issue that still hasn't been resolved. Please vote for it if you want a change.
Better way would be backup the data in the content area and then export the documentType to UTD file. Then Delete the documentType import it back by right clicking root documentType. When importing select master document type.
Oh forgot to tell. Change the MasterDocumentType in xml file(utd) you can do this by editing using a txt file
For umbraco 6+ I've used the following sql query to change the Parent Document Type
There's no way to change the Parent Document Type in the Umbraco Dashboard, only via SQL (use it at your own risk!)
Carlos' solution did the trick for Umbraco 6. Thank you very much! :-)
// Thomas
Couldn't get any of the above solutions to work on umbraco 6.1.6 but this did:
UPDATE umbracoNode SET parentID = {Parent ID} WHERE id = {Content Type ID}
UPDATE cmsContentType2ContentType SET parentContentTypeId = {Parent ID} WHERE childContentTypeId = {Content Type ID}
However it seems to cause an issue with adding custom tabs (i.e. it doesn't), any further solutions to that anyone?
I have used this query to put document types without a master under another master document type. It was build up by posts of other topics here.
USE WebsiteDB; -- Set with your DB name
GO
DECLARE @ContentTypeId INT, @NewParentId INT;
SET @ContentTypeId = 1058; -- set with ID of ContentType to change
SET @NewParentId = 3114; -- set with ID of new parent to set to @ContentTypeId
-- Set new ParentID
UPDATE [cmsContentType2ContentType]
SET [parentContentTypeId] = @NewParentId
WHERE [childContentTypeId] = @ContentTypeId;
-- Remove GroupID from properties that are in inherits groups
UPDATE cmsPropertyType
SET propertyTypeGroupId = NULL
FROM cmsPropertyType
INNER JOIN cmsPropertyTypeGroup ON cmsPropertyType.propertyTypeGroupId = cmsPropertyTypeGroup.id
WHERE (cmsPropertyType.contentTypeId = @ContentTypeId) AND (cmsPropertyTypeGroup.parentGroupId IS NOT NULL);
-- Remove inherits groups
DELETE TB1
FROM cmsPropertyTypeGroup TB1
WHERE (TB1.contenttypeNodeId = @ContentTypeId) AND (TB1.parentGroupId IS NOT NULL);
-- Reading path info
DECLARE @NewParentPath VARCHAR(100);
SELECT @NewParentPath = [path] FROM umbracoNode WHERE id = @NewParentId;
-- Update Path field
UPDATE umbracoNode
SET parentId = @NewParentId
, [path] = @NewParentPath + ',' + CAST(id AS VARCHAR(20))
WHERE id = @ContentTypeId;
Insert into cmsContentType2ContentType Values(@NewParentId,@ContentTypeId)
GO
Afterwards I do a IIS restart and it's working fine.
Thanks for sharing, I'll try that out
The scripts appears to work OK in Umbraco 7 too.
is working on a reply...