Accessory, Extension, Module

Archived
Forum
(read-only)

Kyara

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Nicolas Bottari

     

Not possible to change the length of URL title field

Support Request

Laisvunas
Laisvunas

Hi,

I changed the length of the URL title field in Kyara settings to 150 chars, but it does not work.

The source view in the browser of the Publish page shows that Kyara added these javascript lines:

$("input[name='title']").attr("maxlength""150").after("<span style=\"floatrightmargin: -1.6em 1em 0 0positionrelative\"></span>");
    $(
"input[name='url_title']").attr("maxlength""150").after("<span style=\"floatrightmargin: -1.6em 1em 0 0positionrelative\"></span>"); 

The first line works correctly - I can input 150 chars in Title field, but the second line does not - URL title field still allows only 75 chars.

 

Nicolas Bottari - Zenbu Studio
# 1
Developer
Nicolas Bottari - Zenbu Studio

What version of Kyara are you using?
What version of EE are you using?

I tested with Kyara 1.1 on EE 2.4, and the maxlength=”” attribute for the url_title field changed to the value I set in Kyara.

Laisvunas
# 2
Laisvunas

Yes, the value of maxlength attribute changed, but it’s still not possible to save url_title longer than 75 chars.

Nicolas Bottari - Zenbu Studio
# 3
Developer
Nicolas Bottari - Zenbu Studio

Unfortunately this appears to be something EE does internally. Usually the field’s maxlength=”” attribute and the database VARCHAR() value can be modified through Kyara and it works fine, but in the case of url_title only, the following line is found in /system/expressionengine/libraries/Api.php:

// Field is limited to 75 characters, so trim url_title before querying
$url_title substr($url_title075); 

This shortens the url_title no matter what. You can increase that number if you wish, but is considered a core hack, which I can’t recommend.

Also considering removing the ability to modify url_title altogether in the future: very long url_titles could have SEO implications.