I am facing a problem when adding posts in Arabic. The slugs that are created automatically appear in the form of incomprehensible symbols and do not accept the inclusion of the publication because it does not contain text in the English language. How can I fix this problem and include the link in Arabic. I tried adding Arabic text in your experimental forum and the link was created in Arabic letters correctly, but I did not accept adding the post because the link did not contain an English letter. Please help me to solve this problem, thank you very much
- MSAnswered
Hello,
Slug only work for English. You can modify the
title_slug
method ofapp/libraries/Tec.php
as you need.To allow slug in other then English, you will need to edit
themes/default/views/topics/add.php
&edit.php
and removedata-fv-regexp="true" data-fv-regexp-regexp="^[a-zA-Z0-9\_-]+$"
from slug input.If you change to use Arabic then you might need to edit
permitted_uri_chars
inapp/config/config.php
too.Thank you
- EHAnswered
Thanks For your replay. I’ll try and tell you the result.
- EHAnswered
Mian Saleem Hello Mr mian as you describe i remove the data-fv-regexp=“true” data-fv-regexp-regexp=“^[a-zA-Z0-9_-]+$” from add and edit page. and remove value of permitted_uri_chars in app/config/config.php but still dose not recognize the arabic latter for slug is there is any thing else can do ?
- MSAnswered
Hello,
Please take full screenshot of the page so that I can understand there error and page. If you can share the forum url that will be great.
Thank you
- MSAnswered
Hello,
Please update the
base_url
in theapp/config/config.php
tohttps://
and then try again.The auto slug will only work for English. There is no option to generate slug for Arabic. I have already mention method and files that are responsible for generating the slug.
Thank you
- EHAnswered
can we replace the slug for arabic letters with numbers ?
- MSAnswered
Hello,
Please uncomment the lines at start of
slug
method ofTec.php
and it should look like this after changes.public function slug($slug, $r = 1) { $slug = $this->slugify($slug); if (empty($slug)) { $this->load->helper('string'); $this->slug(random_string('alnum', 16)); } if ($this->settings_model->getTopicBySlug($slug)) { $slug = $slug . $r; $r++; $this->slug($slug, $r); } return $slug; }
This will try to generate slug for Arabic and if failed random string will be used.
Thank you
- EHAnswered
https://www.loom.com/share/7c58159853474450923d5c8f1566a504
Hello Mr. Main as you see when write title in arabic nothing happen just loading circle on the corner but nothing happen.
- MSAnswered
Hello,
That might be due to error. You can check your server’s php error log for error details.
Thank you
- EHAnswered
should I change any thing in thing in database like data type ?
- Login to Reply