Page 5 of 6
Re: Search Engine Friendly URLS with News Module
Posted: Wed Apr 30, 2008 3:05 pm
by Pierre M.
Hello all,
what about trying new News 2.7 with CMSms 1.2.4 ?
Pierre M.
Re: Search Engine Friendly URLS with News Module
Posted: Thu May 01, 2008 8:16 am
by relic
Pierre M. wrote:
Hello all,
what about trying new News 2.7 with CMSms 1.2.4 ?
Pierre M.
well that was alot easier haha, one thing, how do i remove the "news" from url? and instead of "cat number" have "cat name"
thanks
dave
Re: Search Engine Friendly URLS with News Module
Posted: Sat May 03, 2008 10:56 pm
by coupet
Pierre M. wrote:
Hello all,
what about trying new News 2.7 with CMSms 1.2.4 ?
Pierre M.
Excellent idea, I would add: Updating latest cvs News module version to include suggested patch.
Thanks, Darly
Re: Search Engine Friendly URLS with News Module
Posted: Fri Jun 06, 2008 3:19 pm
by viebig
Well, after some workaround about
accents and
special chars on the category and news title not displaying properly I got to this function:
Code: Select all
// Put this function with the if statement on actions.default.php
if (!function_exists('no_accent'))
{
function no_accent($string)
{
$string = utf8_decode($string);
$string = strtr($string,
"\xe1\xc1\xe0\xc0\xe2\xc2\xe4\xc4\xe3\xc3\xe5\xc5".
"\xaa\xe7\xc7\xe9\xc9\xe8\xc8\xea\xca\xeb\xcb\xed".
"\xcd\xec\xcc\xee\xce\xef\xcf\xf1\xd1\xf3\xd3\xf2".
"\xd2\xf4\xd4\xf6\xd6\xf5\xd5\x8\xd8\xba\xf0\xfa".
"\xda\xf9\xd9\xfb\xdb\xfc\xdc\xfd\xdd\xff\xe6\xc6\xdf",
"aAaAaAaAaAaAacCeEeEeEeEiIiIiIiInNoOoOoOoOoOoOoouUuUuUuUyYyaAs");
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
return($string);
}
}
// Add the no_accent() function on these lines
$titleSEO = preg_replace("/[^\w-]+/", "-", no_accent($row['news_title']));
$categorySEO = preg_replace("/[^\w-]+/", "-", no_accent($row['news_category_name']));
The statement "if (!function_exists('no_accent'))" is required because this file is included more than once, so let´s avoid changing another files, and plus bypass a Fatal Error!
Hope you enjoy
Re: Search Engine Friendly URLS with News Module
Posted: Fri Jun 06, 2008 3:45 pm
by calguy1000
@viebig: thanks very much for this little howto, unfortunately, it's just too late to put into CMS 1.3, or I would have.
@Pierre M, coupet, relic: I don't think removing 'news' from the URL is a good idea, the system won't know how to differentiate between a module call, and a page.... There has to be some unique string in the url that tells it that tells the system it's supposed to use the News module.
Re: Search Engine Friendly URLS with News Module
Posted: Fri Jun 06, 2008 4:30 pm
by viebig
Ty for the feedback calguy,
I really wanna join the developer´s team, I have ideas, some time available and knowledge.
This solution is partial. The news module parameters are passed by GET variables, which mean by example that date_format wont work on the details page because of the pretty urls. It´s a price to pay.
The origiral pretty urls contain the return_id, which means that if the news summary are on several pages, we will have duplicated unique links, which is really bad for SEO.
I think a Session Layer could solve most of the duplicated pages and get parameters problem, with some performance cost, of course.
So, I think its best to solve old and actual issues than develop news solutions right now. I would be glad if you can give me some directions about programming tasks to do on cmsms, and first, how to get in officialy into the project.
Ty in advance!
Guilherme Viebig
Re: Search Engine Friendly URLS with News Module
Posted: Fri Jun 06, 2008 4:37 pm
by calguy1000
viebig:
Start with reading this post:
http://forum.cmsmadesimple.org/index.php/topic,2712.0.html
Then, start implementing your changes on your local machine (against the current svn release, you may need to do an svn install of CMS Made simple).
once your patches are complete, and tested... contact me, and I'll look into them.
Once we have a good trust relationship built up, I can grant commit access to the svn repositories.
Also, if you want to become a dev team member, you can start by submitting patches, helping with support, and hanging out in the IRC channel.
Re: Search Engine Friendly URLS with News Module
Posted: Fri Jun 06, 2008 4:44 pm
by calguy1000
This solution is partial. The news module parameters are passed by GET variables, which mean by example that date_format wont work on the details page because of the pretty urls. It´s a price to pay.
Yes, you can't put all of the parameters on the URL AND have a pretty url... you'd just be creating 'another type of ugly'. Also, the date_format parameter is obsolete and should be removed anyways.... the cms_date_format smarty modifier is much better, and much smarter.
The origiral pretty urls contain the return_id, which means that if the news summary are on several pages, we will have duplicated unique links, which is really bad for SEO.
There is the detailpage parameter that works quite well.
i.e: {news detailpage='blah' number=5 category='something'} will generate content with pretty urls (if enabled) that all point to the same page. Alternately, we could add another preference in the options panel that allows specifying a 'default' destination page. (or rename/re-use the one I created to handle this for the rss feed).
Sessions are a bad idea for this stuff, as it means that if a person shares a link with another person, they may not necessarily see the same content or in the same way. Better solutions are reasonable defaults, and parameters in the tags. A better mechanism is reasonable defaults, it limits the functionality a bit, but only slightly. Also, there are other things that could be done with URL mapping, etc.
Re: Search Engine Friendly URLS with News Module
Posted: Tue Oct 28, 2008 7:05 pm
by kendo451
Re: Search Engine Friendly URLS with News Module
Posted: Tue Apr 14, 2009 7:22 am
by NiGhMa
Hi All,
I'd like to have news url's like this :
http://www.mywebsite.com/news (for summary page)
http://www.mywebsite.com/news/articleid-news_title (for detail page)
Is it possible ? Could you help me please ?
Thanks a lot
Re: Search Engine Friendly URLS with News Module
Posted: Tue Apr 14, 2009 8:07 am
by Hereistos
Re: Search Engine Friendly URLS with News Module
Posted: Tue Apr 14, 2009 10:47 am
by NiGhMa
Is this meanning there are a "built-in" solution for the URL rewriting for News with the version 1.5.4 ?
I just installed a new CMSMS 1.5.4 with démo content and set
Code: Select all
$config['internal_pretty_urls'] = true;
Menu's items are well rewrited but not the titlelink in the news summary block.
What's wrong ? What I forget ?
Re: Search Engine Friendly URLS with News Module
Posted: Tue Apr 14, 2009 9:04 pm
by Dr.CSS
Have you also set the use hierarchy to true, many modules require this as it says in the comment above it...
Re: Search Engine Friendly URLS with News Module
Posted: Wed Apr 15, 2009 6:29 am
by NiGhMa
Thanks Mark!
That's just that et that works now!
Youpie!
Re: Search Engine Friendly URLS with News Module
Posted: Tue Oct 12, 2010 10:00 pm
by requish
Hi,
I have a little problem with Pretty URLs using News action=browsecat with MLE CMS Edition (1.6.7)

.
In list of categories I have links looks like this (nevertheless in another place mod_rewrite works fine):
http://www.xxx.com/index.php?mact=News, ... d=19&hl=en
What to do if I would like to links looks that:
http://www.xxx.com/en/name-category.html
Help
