SEF URL for K2 v2.6.7

Written by
(0 votes)

Current K2 v2.6.7 is not full support Sef url replacements to some languagues (ex: vietnamese) ! K2 v.2.6.3 full support SEF URL

admin suggest using other ext, I do not like at all, actually if using other ext I will return using Joomla Content not using K2. 

 

Go to Parameters > select Advanced tab

SEO (Full vietnamese unicode characters, you can add your languages) set

- Enforce SEF URL character replacements => Yes

- SEF URL character replacements =>

– |, – |, ?|,...|-, ?|,...|-À|A, \\\"|, \\\"|, \\\"| , \\\"| , ‘|, ‘|, ’|, ’|, “|, “|, ”|, ”|, Á|A, á|a, à|a, À|A, â|a, Â|A, Ä|A, ä|a, Ă|A, ă|a, Ă|A, Ā|A, ā|a, ã|a, Ã|A, Å|A, å|a, Ą|A, ą|a, ấ|a, Ấ|A, ầ|a, Ầ|A, ắ|a, Ắ|A, ằ|a, Ằ|A, ẫ| a, Ẫ|A, ẵ|a, Ẵ|A, ả|a, Ả|A, ẩ|a, Ẩ|A, ẳ|a, Ẳ|A, ạ|a, Ạ|A, ậ|a, Ậ|A, ặ|a, Ặ|A, Ć|C, ć|c, Ċ|C, ċ|c, Ĉ|C, ĉ|c, Č|C, č|c, Ç|C, ç|c, Ď|D, ď|d, Đ|D, đ|d, ð|d, é|e, É|E, è|e, È|E, Ė|E, ė|e, ê|e, Ê|E, Ë|E, ë|e, Ě|E, ě|e, Ĕ|E, ĕ|e, Ē|E, ē|e, ẽ|e, Ẽ|E, Ę|E, ę|e, ế|e, Ế|E, ề|e, Ề|E, ễ|e, Ễ|E, ẻ|e, Ẻ|E, ể|e, Ể|E, ẹ|e, Ẹ|E, ệ|e, Ệ|E, Ġ|G, ġ|g, Ĝ|G, ĝ|g, Ğ|G, ğ|g, Ģ|G, ģ|g, Ĥ|H, ĥ|h, Ħ|H, ħ|h, ı|i, Í|I, í|i, Í|I, Ì|I, ì|i, Ì|I, İ|I, Î|I, î|i, Ï|I, ï|i, Ĭ|I, ĭ|i, Ī|I, ī|i, Ĩ|I, ĩ|i, Ĩ|I, Į|I, į|i, ỉ|i, Ỉ|I, ị|i, Ị|I, Ĵ|J, ĵ|j, ĸ|k, Ķ|K, ķ|k, Ĺ|L, ĺ|l, Ŀ|L, ŀ|l, Ľ|L, ľ|l, Ļ|L, ļ|l, Ł|L, ł|l, Ń|N, ń|n, Ň|N, ň|n, Ñ|N, ñ|n, Ņ|N, ņ|n, ʼn|n, Ŋ|N, ŋ|n, ó|o, Ó|O, ò|o, Ò|O, ô|o, Ô|O, Ö|O, ö|o, Ŏ|O, ŏ|o, Ō|O, ō|o, Õ|O, õ|o, õ|o, Õ|O, Ő|O, ő|o, ố|o, Ố|O, ồ|o, Ồ|O, Ø|O, ø|o, ỗ|o, Ỗ|O, ỏ|o, Ỏ|O, ơ|o, Ơ|O, ổ|o, Ổ|O, ọ|o, Ọ|O, ớ|o, Ớ|O, ờ|o, Ờ|O, ỡ|o, Ỡ|O, ộ|o, Ộ|O, ở|o, Ở|O, ợ|o, Ợ|O, Ŕ|R, ŕ|r, Ř|R, ř|r, Ŗ|R, ŗ|r, Ś|S, ś|s, Ŝ|S, ŝ|s, Š|S, š|s, Ş|S, ş|s, ſ|s, Ť|T, ť|t, Ţ|T, ţ|t, Ŧ|T, ŧ|t, ú|u, Ú|U, ù|u, Ù|U, Û|U, û|u, Ü|U, ü|u, Ŭ|U, ŭ|u, Ū|U, ū|u, ũ|u, Ũ|U, Ů|U, ů|u, Ų|U, ų|u, Ű|U, ű|u, ủ|u, Ủ|U, ư|u, Ư|U, ụ|u, Ụ|U, ứ|u, Ứ|U, ừ|u, Ừ|U, ữ|u, Ữ|U, ử|u, Ử|U, ự|u, Ự|U, Ŵ|W, ŵ|w, ý|y, Ý|Y, ỳ|y, Ỳ|Y, Ŷ|Y, ŷ|y, ÿ|y, Ÿ|Y, ỹ|y, Ỹ|Y, ỷ|y, Ỷ|Y, ỵ|y, Ỵ|Y, Ź|Z, ź|z, Ż|Z, ż|z, Ž|Z, ž|z, α|a, Α|A, ά|a, Ά|A, β|b, Β|B, γ|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О|O, о|o, Ӧ|O, ӧ|o, Ө|O, ө|o, Ҩ|O, ҩ|o, Ӫ|O, ӫ|o, Ӏ|I, Ӏ|i, П|P, п|p, Ҧ|PF, ҧ|pf, Р|P, р|p, С|S, с|s, Ҫ|S, ҫ|s, Т|T, т|t, Ҭ|TH, ҭ|th, Ћ|T, ћ|t, У|U, у|u, Ӱ|U, ӱ|u, Ў|U, ў|u, Ӯ|U, ӯ|u, Ӳ|U, ӳ|u, Ү|U, ү|u, Ұ|U, ұ|u, Ф|F, ф|f, Х|H, х|h, Ҳ|H, ҳ|h, Ц|TS, ц|ts, Ҵ|TS, ҵ|ts, Ч|CH, ч|ch, Ҷ|CH, ҷ|ch, Ҹ|CH, ҹ|ch, Ӵ|CH, ӵ|ch, Ӌ|CH, ӌ|ch, Џ|DZ, џ|dz, Ш|SH, ш|sh, Щ|SHT, щ|sht, Ъ|A, ъ|a, Ы|Y, ы|y, Ӹ|Y, ӹ|y, Ь|Y, ь|y, Ҍ|Y, ҍ|y, Э|E, э|e, Ӭ|E, ӭ|e, Ю|YU, ю|yu, Я|YA, я|ya, Ҏ|P, ҏ|p, Ӆ|L, ӆ|l, Ӊ|N, ӊ|n, Ӎ|M, ӎ|m, Ӕ|E, ӕ|e, Ӡ|DZ, ӡ|dz

 

Advanced SEF Settings set

- Enable advanced SEF for K2 URLs => Yes

 

Edit K2 code

modified ROOT\administrator\components\com_k2\tables\k2category.php file

at line 135 remove code 

 

// Detect the site language we will transliterate

//Remove by VietPublic.net

/* 

if ($this->language == '*')

{

$langParams = JComponentHelper::getParams('com_languages');

$languageTag = $langParams- >get('site');

}

else

{

$languageTag = $this->language;

}

$language = JLanguage::getInstance($languageTag);

$this->alias = $language- >transliterate($this->alias);

$this->alias = JFilterOutput::stringURLSafe($this->alias);

if (trim(str_replace('-', '', $this->alias)) == '')

{

$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');

} */

 

after line add line 177

$this->alias = JFilterOutput::stringURLSafe($this->alias); // Add by VietPublic.net

 

Similar 

modified ROOT\administrator\components\com_k2\tables\k2item.php file

at line 122 remove same above code

after line 160 add same above code

 

SIMPLY METHOD: DO NOT NEED HACK K2 CODE:

Edit ROOT language\vi-VN\vi-VN.localise.php file (similar your language)
Change line from 104 to line 111 below code

    $glyph_array = array(
        'a' => 'á,à,ả,ã,ạ,À,Á,Ả,Ã,Ạ,â,ầ,ấ,ẩ,ẫ,ậ,Â,Ầ,Ấ,Ẩ,Ẫ,Ậ,ă,ằ,ắ,ẳ,ẳ,ặ',
        'd' => 'd,Ð',
        'e' => 'è,é,ẻ,ẽ,ẹ,È,É,Ẻ,Ẽ,Ẹ,ê,ề,ế,ể,ễ,ệ,Ê,Ề,Ế,Ể,Ễ,Ệ',
        'i' => 'í,ì,ỉ,ĩ,ị,Ì,Í,Ỉ,Ĩ,Ị',
        'o' => 'ò,ó,ỏ,õ,ọ,ơ,ờ,ớ,ở,ỡ,ợ,Ò,Ó,Ỏ,Õ,Ọ,Ơ,Ờ,Ớ,Ở,Ỡ,Ợ,ô,ồ,ố,ổ,ỗ,ộ,Ồ,Ố,Ổ,Ỗ,Ổ,Ộ',
        'u' => 'ù,ú,ủ,ũ,ụ,Ù,Ú,Ủ,Ũ,ư,ừ,ứ,ử,ữ,ự,Ư,Ừ,Ứ,Ử,Ữ,Ự',
        'y' => 'ý,ỷ,ỳ,ỹ,ỵ,Ỹ,Ỷ,Ỵ,Ý,Ỳ'

 

Some questions contact to This email address is being protected from spambots. You need JavaScript enabled to view it. or facebook.com/vietpublic

Tut from www.vietpublic.net

Read 17590 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.