DTGE not showing preview in backoffice, just 'Doc Type'
Hi folks -
I'm working on an Umbraco 7.9.2 site that I've inherited and having problems showing the DTGE preview in the backoffice when creating a new document type.
Existing document types that have a DTGE work fine. When I create a new document type and include the DTGE, creating an node of that document type won't display the preview content. I can edit the content in the DTGE fine (and the front end works as expected) - it's just in the backoffice each item in the grid is listed as 'Doc Type'.
Debugging with Chrome I'm not seeing any JS errors - and the XHR requests to nodenumber?dtgePreview=1 are returning the expected content.
What version of the DTGE package are you using? I'm pretty sure we ran into this same issue a couple of months ago but it got fixed in an update. I'd try going to the latest version first and report back.
I've found out what the problem is in my case. Well, the actual problem is my lack of knowledge(!)
I created a document type called MyPage (for example) and in turn created a 'MyPageController'. Inside the 'Index' function/controller action there was some logic to redirect if a certain condition wasn't met. This all worked fine on the front end.
Unfortunately, I had no idea that the controller actions were actually called when rendering the preview in the backoffice! Ouch.
So the workaround was to add code into the Index method:
if (Request["dtgePreview"] != null)
{
return base.Index(model);
}
Why this method should be called from the backoffice and its content not actually used anyway I have no idea. But at the end of the day - it works!
DTGE not showing preview in backoffice, just 'Doc Type'
Hi folks -
I'm working on an Umbraco 7.9.2 site that I've inherited and having problems showing the DTGE preview in the backoffice when creating a new document type.
Existing document types that have a DTGE work fine. When I create a new document type and include the DTGE, creating an node of that document type won't display the preview content. I can edit the content in the DTGE fine (and the front end works as expected) - it's just in the backoffice each item in the grid is listed as 'Doc Type'.
Debugging with Chrome I'm not seeing any JS errors - and the XHR requests to nodenumber?dtgePreview=1 are returning the expected content.
Any help on where to look gratefully appreciated!
Hi Andy,
What version of the DTGE package are you using? I'm pretty sure we ran into this same issue a couple of months ago but it got fixed in an update. I'd try going to the latest version first and report back.
Many thanks, David
Thanks for the reply David -
I've found out what the problem is in my case. Well, the actual problem is my lack of knowledge(!)
I created a document type called MyPage (for example) and in turn created a 'MyPageController'. Inside the 'Index' function/controller action there was some logic to redirect if a certain condition wasn't met. This all worked fine on the front end.
Unfortunately, I had no idea that the controller actions were actually called when rendering the preview in the backoffice! Ouch.
So the workaround was to add code into the Index method:
Why this method should be called from the backoffice and its content not actually used anyway I have no idea. But at the end of the day - it works!
Glad you got this sorted.
is working on a reply...