Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 05, 2020 @ 08:21
    Ismail Mayat
    0

    Grid component view and render templates

    Using umbraco 7.15.3 I have grid set up and in my grid json I have the following:

    {
    "name": "Divider",
    "alias": "divider",
    "view": "/App_Plugins/MyNavy/label.cshtml",
    "render": "/App_Plugins/MyNavy/label.html",
    "icon": "icon-remove",
    "config": {
        "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-style: italic; font-size: 18px",
        "markup": "<hr/>"
    }
    

    } What I am trying to achieve is in grid layout allow editors to put in components and separate them with a divider. I am also using Umbraco graphql package.

    So when i make graphql query the view label.cshtml is being called and I get back json that all works fine.

    In the backoffice when I add the divider component I get the following error:

    Authorization error: Unauthorized access to URL: /App_Plugins/MyNavy/label.cshtml

    Its trying to load the label.cshtml instead of the label.html which is the render one. If I swap render and view values then the backoffice error goes away but then I get error on graphiql

    Am I missing something?

  • Ismail Mayat 4511 posts 10059 karma points MVP 2x admin c-trib
    May 05, 2020 @ 08:24
    Ismail Mayat
    0

    Ok ignore, I just updated again but then did a build now it all works,

    {
        "name": "Divider",
        "alias": "divider",
        "view": "/App_Plugins/MyNavy/label.html",
        "render": "/App_Plugins/MyNavy/label.cshtml",
        "icon": "icon-remove",
        "config": {
            "style": "border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-style: italic; font-size: 18px",
            "markup": "<hr/>"
        }
    }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies