I want to control the output of {TAGS_RESULT_ROW_TAGS}
Macik |
|
---|---|
Unfortunly, there is no predefined method to extend `{TAGS_RESULT_ROW_TAGS}` generation process. As it not use resource strings as done for forum topic tags list with `tags_link_tag` resoure string. In spite of that, we can use some tricks and try to do some customization. Let's see in `tags.php` file, line 239: if ($tag_i > 0) $tag_list .= ', '; $tag_list .= cot_rc_link(cot_url('plug', array('e' => 'tags', 'a' => 'pages', 't' => str_replace(' ', '-', $tag_u), 'tl' => $tl)), htmlspecialchars($tag_t)); $tag_i++; It's where acrual generation is done. This line goes within `foreach` loop. `cot_rc_link` use predefined (built-in) string resource, so we can not alter it. Only we have it's a generated comma separated list of links... {TAGS_RESULT_ROW_TAGS|my_tagslist_customization($this)} The function can look like this (I'm writing it without tests so fix it for your needs): function my_tagslist_customization($tagslist) { $items = preg_split('/\s*,\s*/', $tagslist); foreach ($items as &$item) { $item = preg_replace('>(\w+)</a>',' rel="tag"><span itemprops="keywords">$1</span></a>', $item); } return implode(',', $items); } Or you can do this right in template, example: {TAGS_RESULT_ROW_TAGS|preg_replace('>(\w+?)</a>',' rel="taglink"><span itemprops="keywords">$1</span></a>',$this)}
https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |