New custom section

Hi,

I am trying to add a custom section and I am struggling to get my dashboard to show under it.

Here are my two JSOn files.

{
  "name": "OLS.Section",
  "extensions": [
    {
      "type": "section",
      "alias": "OLS.Section",
      "name": "OLS",
      "meta": {
        "label": "OLS",
        "pathname": "OLS-section"
      }
    }
  ]
}

{
  "$schema": "../../umbraco-package-schema.json",
  "name": "viewstat.extension",
  "version": "0.1.0",
  "extensions": [
    {
      "type": "dashboard",
      "alias": "viewstat.extension",
      "name": "Page Stat View",
      "js": "/App_Plugins/OLSImport/olsimport-extension.js",
      "weight": -1,
      "meta": {
        "label": "OLS",
        "pathname": "viewstat-extension"
      },
      "conditions": [
        {
          "alias": "Umb.Condition.SectionAlias",
          "match": "Umb.Section.Content"
        }
      ]
    }
  ]
}

How can I get the dashboard to show under OLS????

Hi @darrenhunterEmerald ,

The fix for this is in the conditions block of your dashboard JSON. Right now, it’s hardcoded to render in the default Content section.

You just need to update the match property to target your custom section’s alias (OLS.Section) instead of Umb.Section.Content.

Here is the updated dashboard manifest:

{
  "$schema": "../../umbraco-package-schema.json",
  "name": "viewstat.extension",
  "version": "0.1.0",
  "extensions": [
    {
      "type": "dashboard",
      "alias": "viewstat.extension",
      "name": "Page Stat View",
      "js": "/App_Plugins/OLSImport/olsimport-extension.js",
      "weight": -1,
      "meta": {
        "label": "OLS",
        "pathname": "viewstat-extension"
      },
      "conditions": [
        {
          "alias": "Umb.Condition.SectionAlias",
          "match": "OLS.Section"
        }
      ]
    }
  ]
}

Please try this once.

Regards,
Shekhar

Also don’t forget (and that trips my up regularly) is that when you add a custom section that it’s not added to any user group by default. So nobody will see it, even if it’s correctly added unless you specifically add the section to a User Group :smiley:

Thanks for adding that. This has happened with me a lot in the past​:sweat_smile: I wasn’t aware about that when I built my first package. Got to know from a friend about this.