2014-03-13, 06:09:28
(2014-03-12, 10:13:06)TeeJay Wrote: PS: Could interest D.O. :
I have discovered an obvious issue with using nm_show_tag('foo') for to replace "categories" of articles in your main menu. As all those articles under specified "categories" actually belong to "news" menu item (or any other, but it's always only 1 of the categories), whenever you click onto any of articles from anywhere, you'll always loose the current class on the "category" you were looking at. Instead, "news" category gets chosen. It's logical and obvious, I just didn't think of it before, so I wanted to point it out.
Carlos, would you guess what I'd like you to introduce? :-P Just kidding, when real categories become your #1, I'm sure you'll let us know. You're doing a great job.
Hi
Today I worked on categories of News and find sulution but need some help.
My setup:
1. Create 2 new entries in .htaccess file BEFORE original News Manager entries:
Code:
RewriteRule ^category/(.*)/(.*)/(.*)$ index.php?id=category&category=$1&dummy=$2&slug=$3 [L]
RewriteRule ^category/([^/.]+)/?$ index.php?id=category&category=$1 [L]
Code:
<?php
global $NMPAGEURL;
$kat=@$_GET['category'];
$slug=@$_GET['slug'];
if (!$slug=='') {
nm_show_post($slug,false,false);
} else {
$NMPAGEURL = 'category/'.$kat;
nm_show_tag($kat);
}
?>
3. Create normal page with slug 'category', write any content You want and insert DynPages directive '{% menu_category %}'.
In this place component inserts list of articles with selected tag when url is like:
Code:
/category/_software
OR
News Manager post when link is like:
Code:
/category/_software/post/any-news-manager-slug
By using this setup You achieve real categories out of '/news/' context.
Of course You may modify this setup to accomplish Your needs.
Now my question: when modifying $NMPAGEURL and displaying posts with nm_show_tag on '/category/_software' url lots of warnings and notices is shown. Probably my .htaccess modifications are not ideal.
Any suggestions how to improve it? works but not perfectly