Back to Blog Tags Extension Support

Renatio
Renatio

Hi,

I would suggest adding slug field in tags table and leave the "name" attribute as user is typing it.

For example if I type polish characters "śćąć" they are all skipped to nothing instead "scac". It is because of slugify parameter in javascript. So all foreign words are misspelled and cannot be used.

I would like to use full tags names on my website and use slugs for generating urls.

Plugin is great but it is lacking language support. All english strings should be replaced with language strings, so other users can overwrite them in October way without changing plugin files.

Thanks for your work so far :)

d.negativa
t.usami10584
t.usami10584

I think this is not the issue of Blog Tags Extension but of tagbox(one of october-widgets) which is installed automatically with Blog Tags Extension.
If you want to solve this problem for the time being, edit the {octobercms-root}/plugins/bedard/blogtags/vendor/owl/tagbox/widget/assets/js/tagbox.js file on your server.
Comment out the line 103 in tagbox.js (shown below):
.replace(/[^\w-]+/g, '') // Remove all non-word chars
But I should notice that some problem will occur.(apparently non-word chars can be registered as a tag )
So if you completely solve this problem, you should rewrite Regular Expression.
In Japanese I solve this completely, but I don't know how to express the Regular Expression which is valid in your language( 'śćąć'). sorry.

Last updated

vdomah
vdomah

Trying also to solve this. @t.usami10584 hack helped to be able to enter tag into tagbox input. But saving in db gives empty string in name field. Because string is not properly encoded:

insert into vdomah_shoptotags_tags (name, updated_at, created_at) values (��������, 2016-07-22 12:08:24, 2016-07-22 12:08:24

How to solve this?

vdomah
vdomah

Found that string was corrupted by strtolower function in Tag model:

public function setNameAttribute($value)
{
    $this->attributes['name'] = strtolower($value);
}

To solve this - replaced by mb_strtolower

Last updated

frank.qf.cn21056
frank.qf.cn21056

I personally solved this by editing 2 files: {octobercms-root}/plugins/bedard/blogtags/vendor/owl/tagbox/widget/assets/js/tagbox.js (line 103) and {octobercms-root}/plugins/bedard/blogtags/models\Tag.php (line 51).

  1. Comment out tagbox.js line 103 so that it allows chars besides characters and numbers.
  2. Modify Tag.php line 51 so that server would accept your input chars, eg. if you would like to make it work with chinese, change it to: $this->rules['name'] .= '|regex:/^[A-Za-z0-9-\x{4e00}-\x{9fa5}}]+$/u';

Last updated

1-6 of 6