READMEmaster
We couldn't render this README. Read it on GitHub
Umbraco.Community.MCPS
Umbraco.Community.MCPS is an extension for Umbraco CMS that provides a seamless way to propagate content based on customizable rules. The extension aims to provide developers with a tool to empower content editors to create dynamic sites with minimal effort.
Extension usage
- Install the Umbraco.Community.MCPS package. Either from this repository or with the latest nuget found in /bin/debug/
- Run your Umbraco instance and log in to the backoffice.
- If you installed the package from this repository, you may need to run
dotnet buildin the root of the Umbraco.Community.MCPS project to generate the necessary files. - If you installed the package from NuGet, it should already be available in your Umbraco instance.
- If you installed the package from this repository, you may need to run
- Add the
MCPSsection to the relevant user groups in the Umbraco backoffice. - Navigate to the
MCPSsection in the Umbraco backoffice. - Create a new propagation rule based on your requirements.
- Navigate to the
Settingssection in the Umbraco backoffice. - You should now see a new Block in the
McpsBlockfolder.- This block can be used to create dynamically propagated PartialViews.
- Should you require additional properties, you can add them to the
McpsBlockdocument type. - Properties on generated Compositions should not be removed or edited, as they are used by the extension to function correctly.
- Feel free to add additional properties to the Compositions if you understand the implications of doing so.
- Your selected PropertyType will now be available on any content you selected in the propagation rule.
- The PropertyType will be available in the
Contentsection of the Umbraco backoffice. - You can use this PropertyType to create dynamic relationships between content and the propagated blocks.
- The PropertyType will be available in the
- A PartialView will have been generated for your propagation block in the
Views/Partials/McpsBlocks/folder.- This partial can be used to render the propagated blocks in your templates.
- Feel free to edit the PartialView to suit your needs.
- The partial contains some basic suggestions on how to use the propagated blocks, but you can customize it further as needed.
Requirements
- Node LTS Version 20.17.0+
- Use a tool such as NVM (Node Version Manager) for your OS to help manage multiple versions of Node
Node Version Manager Tools
Setup Steps
- Open a terminal inside the
Clientfolder. - Run
npm installto install all dependencies. - Run
npm run buildto build the project. - The build output is copied to
wwwroot\App_Plugins\UmbracoCommunityMcps\umbraco-community-mcps.js.
File Watching
- Add this Razor Class Library Project as a project reference to an Umbraco Website project.
- From the
Clientfolder, runnpm run watchto monitor changes to.tsfiles and rebuild the project automatically. - With the Umbraco website project running, the Razor Class Library Project will refresh the browser when the build is complete.
Suggestion
- Use VSCode as the editor of choice for its strong TypeScript tooling and recommended Lit WebComponent extensions.
