How to customize the links format in the front-end

From TomatoCMS Documentation

Jump to: navigation, search

The default URLs in the front-end section have the format of

  • /en_US/news/article/view/9/36/ for article details pages
  • /en_US/news/category/view/9/ for category pages

How to change these formats to the following one:

  • /news/permalink-management-core-module-9-43.html for article details pages
  • /news/v2071--page-module-9 for category pages

We can use Permalink management
First of all, if your site has only one language, you can disable the multilingual supports feature by going to System > Localization and uncheck the Enable multilingual website check box.
After pressing the Save button, you will not see the locale in the URL.
Now, the article details page has the URL of /news/article/view/9/36/:

File:default_url_article.jpg

Next, in the back-end section, go to the System > Permalink menu.
Here you can see the list of pages which you can customize the URLs. For each page, you can use the default URL, or select one from the list of predefined URLs, or custom by yourself.
For instance, in order to change the URL of article details page, you can select the or Custom URL check box, then enter the format of URL to the custom URL text box.
Note that you don't have to remember the paramaters, because it will show the list of enabled parameters based on your input automatically.

File:configure_permalink.jpg

The URL of news/permalink-management-core-module-9-43.html, in general way, is news/{slug}-{category_id}-{article_id}.html.
And, the general format of news/v2071--page-module-9 is news/{slug}-{category_id}.
Below is what I set these formats:

File:configure_permalink_2.jpg

Finally, press the Save button.
Come back to the front-end section, you will see that our website uses new URL formats.

  • The article details page:

File:linkProvider_article_detail_page.jpg

  • The article category page:

File:linkProvider_article_category_page.jpg

Personal tools