Search Engine Friendly URLS with News Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Pierre M.

Re: Search Engine Friendly URLS with News Module

Post by Pierre M. »

Hello all,

what about trying new News 2.7 with CMSms 1.2.4 ?

Pierre M.
User avatar
relic
Forum Members
Forum Members
Posts: 34
Joined: Fri Dec 08, 2006 9:59 am
Location: New Zealand

Re: Search Engine Friendly URLS with News Module

Post 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
Last edited by relic on Thu May 01, 2008 8:28 am, edited 1 time in total.
coupet
New Member
New Member
Posts: 8
Joined: Tue Feb 12, 2008 3:34 am

Re: Search Engine Friendly URLS with News Module

Post 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
viebig

Re: Search Engine Friendly URLS with News Module

Post 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
Last edited by viebig on Fri Jun 06, 2008 4:06 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Search Engine Friendly URLS with News Module

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
viebig

Re: Search Engine Friendly URLS with News Module

Post 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 
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Search Engine Friendly URLS with News Module

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Search Engine Friendly URLS with News Module

Post 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.
Last edited by calguy1000 on Fri Jun 06, 2008 4:47 pm, edited 1 time in total.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
kendo451

Re: Search Engine Friendly URLS with News Module

Post by kendo451 »

Elijah, these two links in your original instruction set (first post in this thread) are inaccessible:

http://forum.cmsmadesimple.org/index.ph ... ttach=1720
http://forum.cmsmadesimple.org/index.ph ... ttach=1720
NiGhMa
Forum Members
Forum Members
Posts: 16
Joined: Wed Jul 25, 2007 8:13 am

Re: Search Engine Friendly URLS with News Module

Post 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
Hereistos
Forum Members
Forum Members
Posts: 29
Joined: Sat Apr 11, 2009 12:42 am

Re: Search Engine Friendly URLS with News Module

Post by Hereistos »

NiGhMa
Forum Members
Forum Members
Posts: 16
Joined: Wed Jul 25, 2007 8:13 am

Re: Search Engine Friendly URLS with News Module

Post 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 ?
Last edited by NiGhMa on Tue Apr 14, 2009 11:10 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Search Engine Friendly URLS with News Module

Post by Dr.CSS »

Have you also set the use hierarchy to true, many modules require this as it says in the comment above it...
NiGhMa
Forum Members
Forum Members
Posts: 16
Joined: Wed Jul 25, 2007 8:13 am

Re: Search Engine Friendly URLS with News Module

Post by NiGhMa »

Thanks Mark!

That's just that et that works now!

Youpie!
Last edited by NiGhMa on Wed Apr 15, 2009 6:31 am, edited 1 time in total.
User avatar
requish
Forum Members
Forum Members
Posts: 183
Joined: Sat Jan 24, 2009 3:12 pm

Re: Search Engine Friendly URLS with News Module

Post 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  ::)
CMS Made Simple! Best CMS! :)
Locked

Return to “Modules/Add-Ons”