Alias Page PRO - Alias URL Manager for Cotonti

The plugin automatically creates aliases if there are none. Tools for mass editing aliases, meta titles, and article titles in the page module of the CMF Cotonti web application builder

Alias Page PRO — automatic aliases for Page module pages 

Plugin for Cotonti v1.+ 
Automatically creates readable, transliterated aliases (URL paths) for pages of the page module if the user leaves the alias field empty. 
Completely replaces the standard autoalias2 plugin (bundled with Cotonti) — simultaneous use is not allowed and may cause conflicts. 

Important: Do not install this plugin together with the standard autoalias2 (https://github.com/Cotonti/Cotonti/tree/master/plugins/autoalias2) — they perform the same task, and their coexistence will lead to unstable operation. 


Table of Contents


History of creation and the problem it solves

The standard autoalias2 plugin (supplied with Cotonti) uses a language file for Cyrillic transliteration that depends on the site's interface language. If the interface is, for example, Russian, and the page content is Ukrainian, Ukrainian letters (і, є, ї, ґ) are not transliterated and may be removed or left unchanged, spoiling the URL.

Alias Page PRO completely solves this problem:

  • Uses an internal transliteration function that contains a single character table for the Russian and Ukrainian alphabets.
  • Does not depend on system language files — the result is always predictable.
  • Provides a convenient three-tab control panel: statistics, viewing, bulk editing.
  • Allows bulk creation or clearing of aliases for all pages.

Thus, the plugin is a full replacement for the standard autoalias2 with improved functionality and control.


Features

  • Automatic generation of an alias from the page title when adding or editing a page, if the alias field is left empty.
  • Internal transliteration of Cyrillic (Russian + Ukrainian) into Latin — does not depend on Cotonti language files.
  • Removal of all characters except letters, digits, hyphens, underscores, and spaces.
  • Flexible settings:
    • Enable/disable transliteration.
    • Prepend the page ID to the beginning of the alias.
    • Action on duplicate alias (append ID or random number).
    • Word separator choice (hyphen, underscore, period).
    • Convert to lowercase.
  • Administration panel with three tabs:
    • Statistics — total number of pages, how many with alias, without alias, without Meta Title.
    • Lists & Aliases — table of all pages with ID, title, meta title, and alias.
    • Management — bulk editing of title, Meta Title, and alias for several pages at once.
  • Bulk actions on the "Statistics" tab:
    • Create aliases — generate aliases for all pages where the alias is missing.
    • Clear all aliases — completely erase the page_alias field for all pages (with confirmation).
  • Pagination in lists and management forms.
  • Full interface localization (Russian, English).

Requirements

  • Cotonti v1.+ (tested on the latest version)
  • page module (must be installed and active)
  • PHP 8.5+
  • MySQL 8.4+
  • Administrator rights to access the plugin control panel.
  • The standard autoalias2 plugin must be disabled or removed to avoid conflicts.

Plugin structure

aliaspagepro/
├── aliaspagepro.setup.php           # Plugin registration and settings description
├── aliaspagepro.page.php            # Hook for adding/editing a page
├── aliaspagepro.admin.php           # Administration panel
├── inc/
│   └── aliaspagepro.functions.php   # Transliteration, conversion, update functions
├── lang/
│   ├── aliaspagepro.ru.lang.php     # Russian language file
│   └── aliaspagepro.en.lang.php     # English language file
└── tpl/
    └── aliaspagepro.admin.tpl       # Admin panel template

Installation

  1. Disable or remove the standard autoalias2 plugin if it is active (Extensions → AutoAlias 2 → Deactivate).
  2. Download the ZIP archive of the aliaspagepro plugin from the official repository.
  3. Unpack the archive into the plugins/ folder of your site.
  4. Go to the Cotonti admin panel → Extensions.
  5. Find “Alias Page PRO” and click “Install”.

After installation, the plugin starts working immediately — when adding or editing pages, the alias will be generated automatically if the field is left empty.


Plugin settings in admin panel

All settings are available at Extensions → Alias Page PRO → Configuration.

ParameterTypeDefaultDescription
translitradio1 (on)Enables transliteration of non-Latin characters (Cyrillic) into Latin.
prepend_idradio0 (off)Prepend the page ID to the beginning of the alias. Example: 123-page-name.
on_duplicateselectIDAction when a duplicate alias is found (if prepend_id is off): ID — append the page ID to the end; Random — append a random number from 2 to 99.
sepselect-Word separator: hyphen (-), underscore (_), period (.).
lowercaseradio1 (on)Convert the alias to lowercase.

Usage

Automatic alias creation

When you add or edit a page in the page module and leave the “Alias” field empty, the plugin triggers on the hooks page.add.add.done and page.edit.update.done. The alias generation process:

  1. The page title (page_title) is taken.
  2. If transliteration is enabled, the title is passed through the internal function aliaspagepro_transliterate(), which replaces all Cyrillic characters (Russian and Ukrainian) according to a single table.
  3. All characters except letters, digits, hyphens, underscores, and spaces are removed.
  4. Spaces are replaced with the chosen separator.
  5. If lowercase is enabled, all letters become lowercase.
  6. If the “Prepend ID” option is enabled, {id}{separator} is placed before the alias.
  7. Uniqueness check: if the generated alias already exists for another page and prepend_id is off, the page ID or a random number (depending on the on_duplicate setting) is appended to the end.
  8. The final alias is written to the page_alias field.

Administration panel (three tabs)

The panel is accessible via Admin → Tools → Alias Page PRO.

“Statistics” tab

Shows four numbers:

  • Total pages — number of pages with a non-empty title.
  • With alias — pages where the page_alias field is filled.
  • Without alias — pages with an empty alias.
  • Without Meta Title — pages where the meta title (page_metatitle) is not filled.

Action buttons:

  • Create aliases — starts generating aliases for all pages where the alias is missing.
  • Clear all aliases — erases the alias for all pages (confirmation required).
  • Configuration — go to plugin settings.

“Lists & Aliases” tab

Displays a table of all pages (with pagination, 25 records per page) with columns:

  • ID
  • Title (links to the page on the site)
  • Meta Title
  • Alias

Designed for a quick overview of alias statuses.

“Management” tab

Allows editing the title, Meta Title, and alias for several pages at once on one page (10 records per page). The ID field is not editable.

To change data:

  1. Make changes in the desired fields.
  2. Click the “Update” button.

After saving, you will remain on the same pagination page you started from.


Detailed description of each file

Below is a detailed description of all plugin files.


aliaspagepro.setup.php

Purpose: plugin registration in the Cotonti system and description of its settings.

Contains two mandatory sections:

  • [BEGIN_COT_EXT] … [END_COT_EXT] – metadata:
    • Code – unique identifier aliaspagepro.
    • Name – display name.
    • Categoryseo (category in admin panel).
    • Version – current version (2.5.1).
    • Requires_modulespage.
    • Guest and user access rights.
  • [BEGIN_COT_EXT_CONFIG] … [END_COT_EXT_CONFIG] – list of configuration parameters:
    • translit, prepend_id, on_duplicate, sep, lowercase.
    • Each line specifies sorting order, field type (radio/select), default value, and description.

Without this file, Cotonti cannot install the plugin and provide a settings form.


aliaspagepro.page.php

Hooks: page.add.add.done, page.edit.update.done

Executed immediately after adding or updating a page. The code is minimal:

if (empty($ritem['page_alias']))
{
    require_once cot_incfile('aliaspagepro', 'plug');
    $ritem['page_alias'] = aliaspagepro_update($ritem['page_title'], $id);
}

If the alias field is empty, the plugin functions are included and aliaspagepro_update() is called, which generates a new alias based on the title and page ID. The result is written directly into the $ritem array, and the page module saves it to the database.


aliaspagepro.admin.php

Hook: tools

Builds the plugin administration page (under “Tools”). Work logic:

  1. Determines the current tab (tab) and action (a) from the URL.
  2. Assigns navigation variables for the template (active tabs, links).
  3. Special action handling (before tab output):
    • a=create – selects all pages with an empty alias, calls aliaspagepro_update() for each, outputs a message with the number of created aliases.
    • a=clear_aliases – sets the page_alias field to empty for all pages, outputs a clearance message.
    • After execution, redirects to the same tab (preserving parameters).
  4. Tab content generation:
    • Statistics – executes four SQL queries to count metrics, passes them to the template, as well as the URL for the “Create aliases” button.
    • Lists & Aliases – retrieves data with pagination (LIMIT/OFFSET) from the cot_pages table. For each page, computes the URL via cot_page_url(), assigns LIST_ROW_* variables, and parses the LIST_ROW block. If no pages, outputs LIST_EMPTY. Adds pagination.
    • Management – similarly retrieves data with pagination. If a POST request with a=update is received, loops through and updates the title, meta title, and alias for all IDs submitted in the form. Uses $backUrl with the current page number (durl) to return to the same page after saving. The issue with & in the URL is resolved by replacing && before redirection.
  5. Outputs system messages, parses the main MAIN block, and returns HTML.

inc/aliaspagepro.functions.php

Contains the three main plugin functions.

aliaspagepro_transliterate($str)

Internal transliteration function. Takes a string and passes it through a single replacement array sorted from longest sequences to shortest:

  • Unique Ukrainian letters: Є, є, Ї, ї, Ґ, ґ, І, і.
  • Russian letters not present in Ukrainian: ё, Ё, ы, Ы, э, Э, ъ, Ъ.
  • Common multi-character combinations: ЩShch, ЖZh, ХKh, ЦTs, ЧCh, ШSh, ЮYu, ЯYa.
  • Single letters (common to Russian and Ukrainian): АA, бb, etc.
  • Soft sign and apostrophes are replaced with an empty string (removed).

Returns the string with replaced characters. Does not depend on external files.

aliaspagepro_convert($title, $id, $duplicate)

Main function for converting a title into an alias. Steps:

  1. If translit is enabled, calls aliaspagepro_transliterate().
  2. Removes forbidden characters via preg_replace('#[^\p{L}0-9\-_ ]#u', '', $title).
  3. Replaces spaces with the separator from configuration.
  4. If lowercase=1, converts to lowercase.
  5. If prepend_id=1 and $id is not empty, prepends $id . $sep.
  6. If $duplicate=true, appends the ID (if set and ID mode selected) or a random number (Random mode). Returns the finished alias.

aliaspagepro_update($title, $id)

Called when adding/editing a page and during bulk creation. In a do...while loop:

  • Generates an alias via aliaspagepro_convert().
  • If prepend_id is off, checks the database for an existing alias with another page (page_id != $id).
  • If a duplicate is found, sets $duplicate=true, and on the next iteration aliaspagepro_convert will append the ID/random number.
  • Once a unique alias is obtained, updates the record in the cot_pages table.
  • Returns the final alias.

Language files (lang/aliaspagepro.ru.lang.php, en.lang.php)

Contain all text strings: plugin name, description, settings labels (including hints and dropdown values), tab names, messages.
Used by the cot_langfile() function when loading the plugin.


Template tpl/aliaspagepro.admin.tpl

HTML template with XTemplate blocks for the admin panel. Uses Bootstrap 5 (included in Cotonti v1.+). Main blocks:

  • MAIN – page container with tabs.
  • LIST_ROW, LIST_EMPTY – table rows in the “Lists & Aliases” tab.
  • MANAGE_ROW, MANAGE_EMPTY – form rows in the “Management” tab.
  • Pagination is included via the system tag {PAGINATION}.

Tabs are switched via conditional blocks <!-- IF {PHP.tab} == '...' -->.


Usage example

Situation: a site with a Russian interface, but a page is created with the Ukrainian title “Нова сторінка”. The alias is empty.

  1. User saves the page.
  2. The plugin calls aliaspagepro_transliterate('Нова сторінка').
  3. Characters are replaced:
    • НN, оo, вv, аa,
    • сs, тt, оo, рr,
    • іi, нn, кk, аa.
    • Space is replaced with hyphen (sep=-).
  4. With lowercase enabled, we get nova-storinka.
  5. The alias is unique — written to the database.

If the standard autoalias2 were used with a Russian transliteration table, the letter і would have remained unchanged or been deleted, resulting in an incorrect URL.


Troubleshooting

  • Alias is not being created. Make sure the plugin is active and the “Alias” field in the page edit form is empty. Check that the standard autoalias2 plugin is disabled.
  • Table rows are not displayed in the admin panel. Check that the template file aliaspagepro.admin.tpl matches the latest version, and that the LIST_ROW and MANAGE_ROW blocks are directly inside MAIN (not wrapped in other blocks).
  • After saving in “Management”, the URL contains &amp;. This issue was fixed in version 2.5.1 by forcibly replacing &amp;& in the redirect URL. If it still occurs, make sure you have the latest admin.php.
  • Transliteration does not work as expected. The transliteration table is hardcoded in aliaspagepro_transliterate(). If a needed character is missing, add it to the $translit array (file functions.php), maintaining the order from longest sequences to shortest.
  • The “Create aliases” button does nothing. Ensure there are records with an empty page_alias in the cot_pages table. Check database write permissions.
  • Conflict with the autoalias2 plugin. If both plugins are active, unpredictable behavior may occur. Remove or deactivate the standard autoalias2.

License

BSD. Free use and modification while retaining copyright.




Rating based on reviews:
Stars received: 0
Total reviews: 0
Average rating: 0
10 minutes read

Reviews to products

No reviews yet


Add to Cart

Product has no downloadable file

 

Page Discussion in Telegram

Content author

webitproff

Offline

webitproff

Last logged: 2026-08-06 16:37

  • Чем могу помочь?

    Оказываю весь спектр услуг по CMF Cotonti. Разработка открытых и закрытых корпоративных интернет порталов, небольших социальных сетей, торговые площадки, маркетплейсы, биржи фриланса, каталоги товаров оптовых поставщиков, интернет-магазин под заказ, чтобы делать совместные покупки и групповые совместные продажи от имени нескольких продавцов.

  • Разработки на GitHub бесплатно
  • Market PRO Showcase

    CMS, Script and Engine for an online storefront, infoproduct shop and digital goods store. Different prices in different currencies. Online cryptocurrency payments for goods and services.