Useful resources:
Basics of taxonomies: https://www.davidhayden.me/blog/taxonomies-in-orchard-core-cms
Demo of Custom Admin Tree Menu:
Prerequisite:
Install the Admin Tree Module by cloning the https://github.com/ThisNetWorks/ThisNetWorks.OrchardCore.AdminTree repository into the following directory: OrchardCore\src\OrchardCore.Modules and then adding the project under OrcharCore.Modules
- Add the reference below to \OrchardCore\src\OrchardCore\OrchardCore.Application.Cms.Core.Targets\OrchardCore.Application.Cms.Core.Targets.csproj
- <ProjectReference Include=”..\..\OrchardCore.Modules\ThisNetWorks.OrchardCore.AdminTree\src\ThisNetworks.OrchardCore.AdminTree.csproj” />
Install ThisNetWorksAdminTheme by cloning the https://github.com/ThisNetWorks/ThisNetWorks.OrchardCore.Themes repository into the following directory: OrchardCore\src\OrchardCore.Themes and then adding the project under OrcharCore.Themes
- Add the reference below to OrchardCore\src\OrchardCore\OrchardCore.Application.Cms.Targets\OrchardCore.Application.Cms.Targets.csproj
- <ProjectReference Include=”..\..\OrchardCore.Themes\ThisNetWorks.OrchardCore.Themes\src\ThisNetWorksAdminTheme\ThisNetworksAdminTheme.csproj” PrivateAssets=”none” />
- Right now there an issue with the css for this theme not loading correctly https://github.com/ThisNetWorks/ThisNetWorks.OrchardCore.Themes/issues/1
- Temporary workaround for it is following the steps below:
- Copy theme.min.css and theme.css into \OrchardCore\src\OrchardCore.Themes\TheAdmin\wwwroot\Styles
- Edit the file: \OrchardCore\src\OrchardCore.Themes\ThisNetWorks.OrchardCore.Themes\src\ThisNetWorksAdminTheme\Views\Layout.cshtml
- Change this: <style asp-name=”thisnetworksadmintheme” asp-src=”~/ThisNetWorksAdminTheme/Styles/theme.min.css” debug-src=”~/ThisNetWorksAdminTheme/Styles/theme.css”></style>
- With this: <style asp-name=”thisnetworksadmintheme” asp-src=”~/TheAdmin/Styles/theme.min.css” debug-src=”~/TheAdmin/Styles/theme.css”></style>
- Temporary workaround for it is following the steps below:
Steps to set up Taxonomy tree
The goal of the following steps is to create Content Item: “Pages” of Content Type: Taxonomy that will have a tree structure as follows:
- Enable the Taxonomies module under Configuration > Feature [Under Content Management section]
- Go to Content > Content Definition > Content Types to create a new Content Type for the Taxonomy to be created
- Make sure the new content type has the Term Container part included
- Create the Term Content Types for each page category.
- For our example, assuming Main Page has one Content type and Child Page have a different content type, we need to create those two Content Types
- Before we can add the Main Pages, create the Content Type for it called “Branch Article”, which must contain a Taxonomy Field
- Select the Pages taxonomy and the Editor type “Contained”. The editor type change is important to make this Content Type appear under Pages taxonomy’s Term Content Type
- Follow the step #6 to create another Content Type called “Leaf Article” that will contain the parts for the Child Pages
- Create a new Taxonomy called Pages with term type Category
- Add Categories and child categories and organize them in the desired tree structure:
- For each category, the creation page will provide options to pick which type of page would be created under that category:
- Similarly child page can be created with different content type:
Steps to set up Admin Tree
- Enable the Admin Menu and Admin Tree Menus modules under Configuration > Feature [Under Content Management section]
- Enable ThisNetworks Admin Theme by going to Design > Themes section. Enabling this theme will allow Admin Tree Menus to to appear once set up
- Go to Configuration > Admin Menus and click on Add Admin Menu to create a new admin menu:
- Click on Edit Nodes to determine what the Admin Menu should contain
- Click on Add Node to bring up the following pop up:
- Add a Taxonomy Terms Tree using the following settings:
- Once done, the terms of Content Item Categories will appear in the admin menu in as a tree as follows:
- From the tree, pages can be created as follows:
Leave a Reply