But, it doesn't work for 100%, so I'm getting Umbraco section alias, but I wanted to get a section alias inside custom dashboard, I specified dashboard and sections in package.manifest
Oki then. If I'm understanding you correctly, you're then actually looking for the alias of the dashboard and not the alias of the section? Is this correct?
When the overall dashboard of a section is rendered in the backoffice, it consists of one or more tabs, and each tab may consist of one or more properties.
In most cases, you custom dashboard will result in a tab that then has a single property with your custom dashboard view. I'm not even entirely sure how you can have multiple properties under a single tab, but the UI seems to support that.
To get the alias of your custom dashboard, try playing around with these:
// Gets the overall dashboard object (this is not your dashboard)
console.log($scope.dashboard);
// Gets the alias of the tab
console.log($scope.tab.alias);
// Gets the alias of the property
console.log($scope.property.alias);
In most cases, the two aliases are going to be the same.
How to get section alias in Angular
Hello Community
I'm working on a custom dashboard and I need to know section alias in the angular code, how can I do it?
How to get section alias specified in package.manifest?
Thanks, Alex
Hi Alex,
There is an Angular service called
$routeParams
. I don't think Umbraco has any documentation on it as the service comes from Angular, and not Umbraco.Anyways, you can inject the service into your controller via DI like this:
For my simple section, the controller will then write the following object to the log:
I'm not sure how relevant
url
is, butsection
gets you the alias of your section 😉Hi Anders,
Thank you very much for your answer!!!
But, it doesn't work for 100%, so I'm getting Umbraco section alias, but I wanted to get a section alias inside custom dashboard, I specified dashboard and sections in package.manifest
This section alias - "alias": "pictureOfTheDay",
Thank you very much!!! Alex
Oki then. If I'm understanding you correctly, you're then actually looking for the alias of the dashboard and not the alias of the section? Is this correct?
When the overall dashboard of a section is rendered in the backoffice, it consists of one or more tabs, and each tab may consist of one or more properties.
In most cases, you custom dashboard will result in a tab that then has a single property with your custom dashboard view. I'm not even entirely sure how you can have multiple properties under a single tab, but the UI seems to support that.
To get the alias of your custom dashboard, try playing around with these:
In most cases, the two aliases are going to be the same.
This is exactly what I was looking for, thank you so much, Anders!!!!
is working on a reply...