A recurring request on Magento projects is to manage content pages in a tree structure. Indeed, some “flat pages” are not very annoying but when we reached a few dozen pages, it may be useful to organize the pages in a hierarchical way to navigate more easily. This is where the extension Clever CMS (developed by me) comes to our aid and we will discover how to use it throughout this post.
Clever CMS is now hosted on GitHub:
- Magento 1.6+: https://github.com/jreinke/magento-clever-cms (master branch)
- Magento 1.4.x, 1.5.x: https://github.com/jreinke/magento-clever-cms/tree/1.2 (1.2 branch)
Principle of operation
The Clever CMS extension does not remove your existing CMS pages. It simply creates a table cms_page_tree for content and a table cms_page_permission for user groups permissions. The table of contents will be initialized with the home page as the first level and all other pages under it, as a second level pages then. A picture worth a thousand words, here is what your tree should look like if you installed the extension without having touched the CMS pages present by default in Magento:
Important : Clever CMS manages one tree per store view. This is a deliberate choice because in most cases, we use a store view for a specific language.
If we know a little Magento, we see that there is already a default management tree categories in the catalog. The interface is rather intuitive and efficient using drag and drop so I based it to manage pages. You will therefore not be confused by the user experience as it works exactly the same way.
With drag and drop you can:
- move a page or a tree of pages (in the scope of your store view),
- sort your pages.
To create a page, simply click on the parent page in the tree and click the “Add Page” button. Then you fill the information on your page as you did before. Only one field was added, this is “Url Key” which provides the ability to manually manage the URL to your page. The procedure is described in the following section.
By default, if you do not specify a url key explicitly, it will be generated automatically from the “Name” field. The final url to your page will be built by concatenating each key from the root page url to the target page. This gives for example: http://www.mystore.com/faq/clever-cms/how-it-works/ for a page found in “Home > FAQ > Clever CMS > How it works ?”.
Important: if you change the url key of a page, a 301 redirection will be created for your old url that points to the new. This feature can be disabled in “System > Configuration > Content Management > Clever CMS > Create Permanent Redirect for URLs if URL Key Changed.”
If you wish, you can restrict access to certain pages for certain user groups. By default the option is disabled, but to activate it you simply have to change the value in “System > Configuration > Content Management > Clever CMS > Enable permissions”. The management interface is accessible from the menu “CMS > Pages > Manage Permissions” and looks like this:
Important: when creating a page, it is automatically accessible by the user group NOT_LOGGED_IN but none of the other groups, you must change the permissions accordingly.
The Clever CMS extension has been tested and is compatible with the following Magento versions: 1.4.x, 1.5.x and 1.6.x Even if your existing pages are not deleted or modified, it is always prudent to back up your database before installing.
If the extension does not give you full satisfaction for any reason, simply uninstall it or delete it and you will find the pages that you had before extension installation.
Clever CMS provides easy content tree management and has the following advantages:
- installation is quick and trivial,
- intuitive interface with drag and drop,
- flexibility in managing URLs,
- permissions management,
- free extension.
Any comments or feedback is welcome!