Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andy Pickering 2 posts 92 karma points
    Jul 23, 2019 @ 10:10
    Andy Pickering
    0

    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!

  • David Challener 80 posts 444 karma points c-trib
    Jul 23, 2019 @ 11:54
    David Challener
    0

    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

  • Andy Pickering 2 posts 92 karma points
    Jul 23, 2019 @ 12:45
    Andy Pickering
    100

    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:

    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!

  • David Challener 80 posts 444 karma points c-trib
    Jul 23, 2019 @ 15:22
    David Challener
    0

    Glad you got this sorted.

Please Sign in or register to post replies

Write your reply to:

Draft