/ Published in: PHP
Just a quick fix for a tag link issue I came across.\r\n\r\nbroken url:\r\ndomain.com/tag/two word.html\r\n\r\nif you take the spaces in the URL and replace them with pluses (‘+’) it’ll work. For example:\r\n\r\nfixed url:\r\ndomain.com/tag/two+word.html\r\n\r\ntested and working on Joomla 1.5.15, with K2 2.1 and sh404sef 1.0.20_Beta – build_237\r\n\r\nsource shows this file: /modules/mod_k2_tools/tmpl/tags.php\r\nbut it’s the same basic fix for the other files:\r\n/components/com_k2/templates/default/item.php\r\n/components/com_k2/templates/default/category_item.php
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /* // "K2 Tools" Module by JoomlaWorks for Joomla! 1.5.x - Version 2.1 // Copyright (c) 2006 - 2009 JoomlaWorks Ltd. All rights reserved. // Released under the GNU/GPL license: http://www.gnu.org/copyleft/gpl.html // More info at http://www.joomlaworks.gr and http://k2.joomlaworks.gr // Designed and developed by the JoomlaWorks team // *** Last update: September 9th, 2009 *** */ //*****/ //the key part is: `<?php echo str_replace(' ','+',$tag->link); ?>` //*****/ // no direct access ?> <div id="k2ModuleBox<?php echo $module->id; ?>" class="k2TagCloudBlock <?php echo $params->get('moduleclass_sfx'); ?>"> <?php foreach ($tags as $tag): ?> <a href="<?php echo str_replace(' ','+',$tag->link); ?>" style="font-size:<?php echo $tag->size; ?>%" title="<?php echo $tag->count.' '.JText::_('items tagged with').' '.$tag->tag; ?>"> <?php echo $tag->tag; ?> </a> <?php endif; ?> <?php endforeach; ?> <div class="clr"></div> </div>