Permalink Generator
Permalink Generator will generate permalink for your displayable contents
How to install
Please read the dedicated tutorial on https://academy.jahia.com/training-kb/tutorials/administrators/installing-a-module and select the Permalink Generator module from the store.
Get the full documentation on the GitHub page: https://github.com/Jahia/permalink-generator
FAQ
The idea of this module is to try to add a vanity every time that property jcr:title is set:
rule "Create permanent URL on jcr:title set"
when
A property jcr:title has been set on a node
then
Create permanent URL for node node and language property.getLanguage()
end
Here is the way it works
- It check if the module is enabled for your site
- It check if the related node is a displayable node (for node type with a dedicated content template, or for pages)
- It check if current language is the default one. If not, then prefix the vanity with the language (for instance
/frfor french) - Get all parent nodes of type
jmix:navMenuItem(could be a page or a menu label), and get the title of this parent node. - It generates a SEO-friendly URLs using parent titles
- It adds a new default vanity URL on the node
This module uses the Slugigy https://github.com/slugify/slugify library to create a SEO friendly name.
Example of generated URL
Here is an example of page path:
Home / Page 1 / Page 2 / Page 3
When editing the page 3 title, the module will generate such a URL
/page-1/page-2/page-3 or /fr/page-1/page-2/page-3 if fr is not the default language.
Limitation
As the permanent link is based on the parent pages name, if you rename the title of a parent page, then the existing vanity for all the sub-nodes won't be updated.
MIT License
Copyright (c) 2021 Jahia Forge - Code Repository
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.