Search code examples
laravelslugoctobercmsoctobercms-plugins

How to stop slug generation in OctoberCMS



When I write non-unicode letters in OctoberCMS Rainlab blog title, it's converted to English letters such as this:
موضوع جديد
is converted to: modoaa-gdyd
I don't want this, I want only to replace spaces with hyphen to be for example:
موضوع-جديد
How can I do that?


Solution

  • I solved this problem by editing the following file:

    modules\system\assets\ui\storm-min.js

    I emptied the following variables:

    ARABIC_MAP={},PERSIAN_MAP={} 
    

    and edited the slugify function by replacing this line:

    slug=slug.replace(/[^-\w\s]/g,'') 
    

    with this:

    slug=slug.replace(/[^-\w\sء-ي]/g,'') 
    

    so, now the slug accepts Arabic characters normally