I need to change the document type of my top node page. I've read similar posts which say that this is not possible via the UI, but that it may be possible either directly within the database or by copying/pasting nodes.
Question is, what is the best way to go about this? I literally just need the singel 'home' node (the top level node on the site) to use a different document type.
I thought it might be as simple as changing the value of the contentType field in the cmsContent table, but that yields the following error when I try to edit the page in Umbraco:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +54 umbraco.controls.ContentControl..ctor(Content c, publishModes CanPublish, String Id) +780 umbraco.cms.presentation.editContent.OnInit(EventArgs e) +368 System.Web.UI.Control.InitRecursive(Control namingContainer) +333 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
I would just make a new root node and move all the content from the current root node to the new one (with the new document type), when that's done you can delete the old document that you don't need any more.
Thanks Sebastian, I didn't know if this would work, being the root node. I'll give it a try next time though. This time, I actually did the database change as per above and then republished everything from the root node and that cleared the error, so it does seem to have worked.
Wouldn't it be possible to create a package which can let the user change the document type of a node? Something like the Doc Type Extensions package? Don't know if it's possible.
The reply from Samit says that you need to change the cmsContentXml table. I don't think that this is true, this table is changed when publishing so all you need to do is republish the nodes which have had the content type changed and this will be regenerated.
Change document type
Hi,
I need to change the document type of my top node page. I've read similar posts which say that this is not possible via the UI, but that it may be possible either directly within the database or by copying/pasting nodes.
Question is, what is the best way to go about this? I literally just need the singel 'home' node (the top level node on the site) to use a different document type.
Thanks folks
Hi Dan,
I would change this in the database directly. Make a backup before you start :)
Cheers,
Richard
Thanks Richard. Any pointers as to where to look in the database?
I thought it might be as simple as changing the value of the contentType field in the cmsContent table, but that yields the following error when I try to edit the page in Umbraco:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
I would just make a new root node and move all the content from the current root node to the new one (with the new document type), when that's done you can delete the old document that you don't need any more.
Thanks Sebastian, I didn't know if this would work, being the root node. I'll give it a try next time though. This time, I actually did the database change as per above and then republished everything from the root node and that cleared the error, so it does seem to have worked.
Wouldn't it be possible to create a package which can let the user change the document type of a node? Something like the Doc Type Extensions package? Don't know if it's possible.
Change it from the DB -
--1 -- change the contenttypeID (Doing this alone is not enough)
UPDATE
cmsContent SET
contentType = 'new content t' WHERE nodeId='your node id'
--2 Change the content type in the xml content
update
cmsContentXml set the content type in xml
--3 Change/ Map all the properties of the contenttype to the desired contenttype properties
Update cmsPropertyData table for this
And Voilla you are done !!!
Change it from the DB -
--1 -- change the contenttypeID (Doing this alone is not enough)
UPDATE cmsContent SET contentType = 'new content t' WHERE nodeId='your node id'
--2 Change the content type in the xml content
update cmsContentXml set the content type in xml
--3 Change/ Map all the properties of the contenttype to the desired contenttype properties
Update cmsPropertyData table for this
And Voilla you are done !!!
There is a feature request for this - vote it up at http://issues.umbraco.org/issue/U5-61
Hi,
I know this thread is old but I wanted to update.
The reply from Samit says that you need to change the cmsContentXml table. I don't think that this is true, this table is changed when publishing so all you need to do is republish the nodes which have had the content type changed and this will be regenerated.
Tim
I can't highfive but both Samit and Tim Watts are correct.
is working on a reply...