-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Manager Pages #25
Comments
Specify what you mean by "adding new content types" |
Nothing terribly specific, I'm really just at the learning phase and I do best by practicing and playing around. But, what I was thinking was, I want to create some sort of custom content sections that could be pulled into different pages through custom blocks. For example, if I had a staff list, I would manage them in the admin and then add them to which ever page needs the staff to show. This way I don't have to repeat content input and if there is a change to one it will change anywhere it is shown. |
I've been trying to see if I could make sense of how it is all set up in the source. Not really getting far in that, Is the platform built with the idea of people making custom management sections? |
Sorry for not having the time to respond. You can add custom pages to the manager with either MVC or Razor Pages just like in any application and then add them to the menu. The only important thing to remember is that you should add them to the Manager Area, otherwise your pages won’t find the shared resources such as layout, partials and so on that is a part of the default manager. A good example is to look at the Identity package which adds custom pages to the manager made with both MVC and Razor Pages. https://github.com/PiranhaCMS/piranha.core/tree/master/core/Piranha.AspNetCore.Identity Regards |
Is there a more basic example? also when you say "add them to the manager area" do you mean the path here "Areas/Manager/Views" |
And, thanks again for all your help. I'm really liking Piranha CMS even though it is taking me a while to fully grasp how to use it. |
No problems! As soon as you run into things that’s unclear and needs more documentation, don’t hesitate to add an issue for it in our docs repo! |
And when I say add to the manager area I mean.
Regards |
I'm transferring this issue to the documentation repo! |
It probably won't be hard to mimic the identity part, but how do you get the manager to find it? How do you add it? |
@traustitj Could you elaborate, I don't really understand what you mean 😊 |
ok, lets say I write some easy name list management system. How do I add config so I can use it inside the management interface? Is there nothing to add in Configure and Configure services in startup.cs? How do I add a menu for the management? The add/edit/list functions. How do I get it to appear? A small tutorial about just adding 1 string and have a list and adding inside the management system would be greatly beneficial. |
@traustitj In the next version of the templates we have added an template for creating custom Piranha Module. This template contains an empty pages that is added to the manager menu and some permissions, an embedded file provider is also added for recourses. I hope this will help you out a bit, you can find the sourse here: |
@filipjansson Thank you. I don't need to add anything to startup.cs ? |
@traustitj Yes, and what depends on how you want to do it. But check out the TemplateModuleExtensions.cs class that has extensions methods for both It just gives you the option to write
Or
|
Hei. I get some errors. I made a clean project, added things as I think they fit, but it probably is just missing a tiny bit. Here is the project |
@filipjansson When the Menu item is created here: It’s referencing the menu group “PiranhaModule”, but I can’t see any code creating it. Won’t this result in a NullReferenceException? |
Did some updates to the module template https://github.com/PiranhaCMS/piranha.core.templates/tree/features/template-options/src/module |
@tidyui I updated my project based on your changes. But I still get an error on Menu.Items[.... |
I just fixed the bug, the answer is to register a menu item first. The fix is in my repo. |
@tidyui @traustitj That is correct. I copied the codebase from another project of mine, but in that project I added the module under the Content section in the menu. |
Yes @traustitj That fix was present in the changes I pushed (https://github.com/PiranhaCMS/piranha.core.templates/blob/features/template-options/src/module/Module.cs#L60). I tested the template on a new project before committing the changes |
Are there any instructions on the best way to customize the manger? I see how to add to the menu, but are there examples of adding new content types in the admin?
The text was updated successfully, but these errors were encountered: