Sorry to be so late with a response, but I did this with a UDT and a modification to my .htaccess file.
First I created a UDT called
news_category_url
Code: Select all
$name = preg_replace(array("/ /", "/[^A-Za-z0-9-\-]/", "/--/"),array("-", "", "-"),$params['name']);
$id = $params['id'];
echo 'blog/category/'.$id.'/'.$name.'.htm';
You will need to change the
.htm in the code above to whatever extension you are using on your site.
Then edit your News Category Template.
Find:
Code: Select all
{if $node.count > 0}
<a href="{$node.url}">{$node.news_category_name}</a> ({$node.count}){else}<span>{$node.news_category_name} (0)</span>{/if}
Change it to:
Code: Select all
{if $node.count > 0}
<a href="{news_category_url name=$node.news_category_name id=$node.news_category_id}">{$node.news_category_name}</a> ({$node.count}){else}<span>{$node.news_category_name} (0)</span>{/if}
Finally add a line like this to your .htaccess file before the CMSMS rewrite rules that add the trailing slash (or extension) and the page rewrite rule:
Code: Select all
RewriteCond %{HTTP_HOST} ^yoursite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yoursite.com$
RewriteRule ^news/category/([0-9]+)/(.+).htm index.php?mact=News,cntnt01,default,0&cntnt01detailpage=15&cntnt01category_id=$1&cntnt01returnid=15 [NC,L]
In the above code you will need to change the
.htm to whatever extension you are using for your site. You will also need to change the
detailpage=15 and
returnid=15 to the id of the page you want the listings to be displayed on. You may also need to change the
news/category... to match the links you are building (see questions and answers below for an
example .htaccess file).