This post covers refactoring code related to the CakePHP Tree Behavior and slugs in Willow CMS. Originally, both Articles and Tags had duplicated code for tree operations. This was refactored into the OrderableBehavior, making the code reusable and testable. Similarly, slug management, previously scattered across multiple locations, was consolidated into the new SlugBehavior. This behavior handles slug generation, validation, and history, simplifying the ArticlesTable and TagsTable classes while adding features like automatic slug generation from titles, custom slugs, and slug history tracking for better SEO. This refactoring significantly reduced code duplication and improved maintainability and testability.
Page 1 of 1, showing 1 record(s) out of 1 total
About
Welcome to willowcms.app. This site uses Willow - a content management system I'm building in the open. Here you'll find development updates, feature highlights, and guides on using Willow for your own sites.