Umbraco 15 Custom Sections Create
# help-with-umbraco
w
Hello everyone, I took a break from developing with Umbraco after version 8, and now I’m working on a project with version 15. However, it has evolved into a very different structure, and I’m struggling to adapt. I want to create and use a new Section, but I haven’t been able to get it to work. I’ve read the documentation, talked to AI (applied the suggestions but they didn’t work), and tried everything, but nothing has worked so far. Friends, can you please explain how to add a Section in Umbraco 15? I really need help because I can’t figure it out. https://cdn.discordapp.com/attachments/1333604093654073364/1333604093930770493/image.png?ex=67997f19&is=67982d99&hm=b9e85a8ce5ed00a7d8d46a6a8276cb2e661c8dc92ddaa43465adf13155b0a632&
s
I will recommend to start with
dotnet new umbraco-extension
as described a bit more here: https://kjac.dev/posts/rebuilding-a-package-for-umbraco-15/ No need to follow the whole article, just to get you started with the right setup for making Umbraco extensions. AI will absolutely not help you as the models are 1-2 years behind and don't know anything about Umbraco after v13 😦
w
I followed this process, but I couldn’t see it in the user section to authorize it.
Thank you for sharing this; I think I need to create it like a new project and add it. I'm reviewing the article right away.
s
Sections are always for authorized users only. They're hidden by default, and you need to add permissions to your logged in user to be able to see the section. (but this is no different from Umbraco 8)
w
Yes, you're right; it's written like this in all the documentation. However, when I want to grant permissions to a user after logging in, I can't see it on that screen.
s
Not sure what you mean. The user needs to be a in a user group and that group needs to have access to the section. This should happen before they log in, but I guess you could write some code that makes it happen during login, not sure. They would need to refresh their browser at least I would think. https://cdn.discordapp.com/attachments/1333604093654073364/1333760167845822514/image.png?ex=679a1074&is=6798bef4&hm=0c1b3eebf45c080d5cf6cd20078483f996a8b9b6f89e568df6ad779ba8861b64&
s
Try looking in the extension insights in settings, if it has registered your extension. You can search for the alias
if its not there, then your manifest might be wrong, or not "visible" to the site. Also, there is no AngularJs in the new backoffice, so your my-custom-section.js wont work
s
This project is a bit old (early v14 days) but does have a custom section, which might help you debug your own: https://github.com/KevinJump/TimeDashboard I would clone this one and make it run locally so you can explore how everything fits together.
More recently updated for v15 is the Sustainability package, which has it's own section: https://github.com/umbraco-community/Umbraco.Community.Sustainability/tree/v3/dev
So I had to change the example in the documentation a little, mainly to add
export const manifests = [section];
Attached is a complete example of how far I got. You should be able to pick the section now.
Umbraco.Extensions.Extension\Client
has the source code for the section (run
npm install && npm run build
in that directory) and
Umbraco.Extensions.Test
is the Umbraco project to run. Username:
test@test.com
Password:
test123456
https://cdn.discordapp.com/attachments/1333604093654073364/1333819796743262360/Umbraco.Extensions.Test.zip?ex=679a47fc&is=6798f67c&hm=0569ee21eb997814a7bd0a2d1108acb90186350afde9405def7402f175578ade& https://cdn.discordapp.com/attachments/1333604093654073364/1333819797363757106/image.png?ex=679a47fc&is=6798f67c&hm=5fb4ee6b681c2d96a6bb32a2ccee6909d2602decf21f739b9b731d71f3c27ccc&
w
Thank you for your support
I would like to clearly state that this was very useful for me. I will pray for you. Thank you very much indeed
35 Views