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.
WebGirl

Re: Search Engine Friendly URLS with News Module

Post by WebGirl »

and some clients need pretty urls because they have to PRINT them on flyers - yes, paper :)

so the easier the better

:)
KoalaBlue
Forum Members
Forum Members
Posts: 39
Joined: Tue Sep 12, 2006 4:23 am

Re: Search Engine Friendly URLS with News Module

Post by KoalaBlue »

Hi, has anyone uploaded the News-Beatiful-URLs.patch or Updated-Pretty-News-URLs-Patch.patch?

I have downloaded it, but how do I 'apply the patch'?  Where do I upload it to?

???  Thx
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: Search Engine Friendly URLS with News Module

Post by Elijah Lofgren »

KoalaBlue wrote: Hi, has anyone uploaded the News-Beatiful-URLs.patch or Updated-Pretty-News-URLs-Patch.patch?

I have downloaded it, but how do I 'apply the patch'?  Where do I upload it to?

???  Thx
1. Assuming you're using Windows, download and install TortoiseSVN: http://tortoisesvn.tigris.org/
2. Check out the SVN of the News module. Looking at http://dev.cmsmadesimple.org/scm/?group_id=8 you'll use this URL:
3. Download the patch file: http://dev.cmsmadesimple.org/tracker/do ... 1-05.patch into your "News" module folder.
4. Right click on the "Pretty-News-URLs-2006-11-05.patch" file and choose: "TortoiseSVN -> Apply Patch..."
5. In the little window that comes up double-click on action.default.php
6. In the other window choose "File -> Save".
7. Back in the little window, double-click on News.module.php
8. In the other window choose "File -> Save".

There. Patched. (On Linux it's much easier. Just one command to apply a patch.)

Or..... To take the easy way. Just download the action.default.php.txt and News.module.php.txt files attached to this post. Rename to remove the .txt extension and overwrite your current two files in modules/News with them.

In addition you need to have a .htaccess file like this:

Code: Select all

Options +FollowSymLinks
RewriteEngine on

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

And make sure you have these settings turned on in config.php

Code: Select all

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

I hope this helps,

Elijah

[gelöscht durch Administrator]
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
KoalaBlue
Forum Members
Forum Members
Posts: 39
Joined: Tue Sep 12, 2006 4:23 am

Re: Search Engine Friendly URLS with News Module

Post by KoalaBlue »

Hi Elijah, how's college? Thanks for taking the time out to reply :)

I'm using a Mac, so I'll go with your second option - thanks a bunch!
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: Search Engine Friendly URLS with News Module

Post by Elijah Lofgren »

KoalaBlue wrote: Hi Elijah, how's college? Thanks for taking the time out to reply :)

I'm using a Mac, so I'll go with your second option - thanks a bunch!
You're welcome.  :)

College is going good. I'm keeping busy, but this weekend is a little less busy than normal which is nice.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
baselve

Re: Search Engine Friendly URLS with News Module

Post by baselve »

Is it right that the patch isn't compatible with newest version of the news module?
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: Search Engine Friendly URLS with News Module

Post by Elijah Lofgren »

baselve wrote: Is it right that the patch isn't compatible with newest version of the news module?
Seemed to patch fine here:
elijahlofgren@kubuntu:~/www/cmsmadesimple/modules/News$ patch -p0 < Pretty-News-URLs-2006-11-05.patch
(Stripping trailing CRs from patch.)
patching file action.default.php
Hunk #1 succeeded at 183 (offset 15 lines).
(Stripping trailing CRs from patch.)
patching file News.module.php
Attached is the two patched files. Just remove the .patched.txt extension and overwrite the 2 files in modules/News

Hope this helps,

Elijah

[gelöscht durch Administrator]
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
baselve

Re: Search Engine Friendly URLS with News Module

Post by baselve »

Thank for the quick response Elijah! Unfortunately I have a problem with your patched files, when I click trough my news message with the beautiful url patch (news 2.2.) I get only the content of the news so no design.

Code: Select all

<h1><a href="">Orange in de etalage</a></h1>

<div class="NewsContent">
         <a name="meer"></a>
        <p><img src="uploads/images/orange_logo.png" alt=" " align="right" height="142" width="142" />France Télécom wil af van de Nederlandse tak van het dochterbedrijf <a href="http://www.orange.nl/over_ons/over_orange/het_bedrijf/" target="_blank">Orange</a>. Orange Nederland is de kleinste aanbieder van mobiele telefonie in Nederland. Vorig jaar besloot France Télécom nog dat Wanadoo onder de naam Orange moest doorgaan om zo één sterk merk te vormen. Ondanks verwoede pogingen heeft Orange nooit echt voet aan de grond kunnen krijgen in Nederland.</p><p> </p><p>Orange is sinds 2003 actief in Nederland. Orange heette in Nederland eerder <a href="http://nl.wikipedia.org/wiki/Dutchtone" target="_blank" title="Dutchtone">Dutchtone</a>. France Télécom voert het merk Orange wereldwijd in 135 landen. </p>

</div>

<div class="Terug"><a href="">Terug</a></div>
<div class="Reacties">Reacties(0)</div>

</div>
I hope you understand what I mean... in the source code head, meta etc is missing when clicking through wit patched news files... so you get an unstyled page with only the newsitem in the source code...
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: Search Engine Friendly URLS with News Module

Post by Elijah Lofgren »

Sorry it didn't work out.

I'll hopefully have time to look at this sometime (I've labeled it TO DO in my Gmail inbox).

Right now I'm swamped with school. Maybe Spring break (About a month).

Later,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: Search Engine Friendly URLS with News Module

Post by carasmo »

I just get a file not found error after clicking on the pretty urls
baselve

Re: Search Engine Friendly URLS with News Module

Post by baselve »

Elijah Lofgren wrote: Sorry it didn't work out.

I'll hopefully have time to look at this sometime (I've labeled it TO DO in my Gmail inbox).

Right now I'm swamped with school. Maybe Spring break (About a month).

Later,

Elijah
Ok, thanks for the effort! Good luck with school and I hope you find time to fix it!! Would be great!
Lloyd Winthorpe III

Re: Search Engine Friendly URLS with News Module

Post by Lloyd Winthorpe III »

It works, the boy is a genius. Here is slight hack to patching process to make it work:

1. Use tortoise to patch news.module.php, copy the patched file to /news

2. copy his uploaded "action.default.php.txt" to the /news folder. remove the .txt by renaming.

Use this slightly modified .htaccess
Options +FollowSymLinks
RewriteEngine on

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule (.*) index.php?page=$1 [QSA]
RewriteRule ^index.php$        index.php

Patching both didn't work. Copying both didn't work. But a combination of the two does. Also, .htaccess can be very finicky. Whether it works depends on your server's config.
Last edited by Lloyd Winthorpe III on Fri Feb 16, 2007 3:34 pm, edited 1 time in total.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: Search Engine Friendly URLS with News Module

Post by carasmo »

Tortiose is not avaialbe to me. Do you have a copy of that file you merged, did you merge it from the latest news module that puts the title in the title bar?

The copying of the files and following the original instructions results in pretty urls with file not found and the "more" link is gone on the pages.

Thanks!
baselve

Re: Search Engine Friendly URLS with News Module

Post by baselve »

Tortoise is available here:http://tortoisesvn.tigris.org/

unfortunately it still doesn't work for me ..
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: Search Engine Friendly URLS with News Module

Post by carasmo »

I'm on a mac and I can't figure out what this tortiose is. Does it compare files and then find where to put the stuff in? Can anyone help me get pretty urls. The instructions here just don't work.
Locked

Return to “Modules/Add-Ons”