iFinity Blogs 

Improve Urls for the Ventrian News Article Module with the News Articles Friendly Url Provider

Dec 15

Written by:
Thursday, December 15, 2011 10:11 AM  RssIcon

The big change for Url Master 2.5 was the inclusion of the ability to build custom module providers for generating module-specific Friendly Urls.  Part of this strategy was to develop a set of module providers for popular third-party modules.  This kicked off with the DotNetNuke Blog module provider.  

The next module provider to be developed is the News Articles Friendly Url Provider, which transforms the Urls generated and used by the Ventrian News Articles module.

The new provider is a plug-in for the Url Master module, and provides seamless and easy-to-use features that completely change the way News Articles Urls look.

Improvements to Article Urls

Consider this Url which is generated by installing the News Articles module on a fresh DotNetNuke 6 installation:

http://example.com/newsarticles/tabid/135/articleType/ArticleView/23/The-Title-of-the-Article.aspx

By implementing the Url Master module, plus the News Articles Friendly Url Provider, and setting a few options*, the above Url can be changed to this:

http://example.com/the-title-of-the-article

Yes, you read that right, that’s how short you can get the Url.

But maybe you use the News Articles module as a blog, and you want some Urls that make it clearly identifiable as a blog.  Change the options **,  and you can have your Url look like this:

http://example.com/2011/12/15/the-title-of-the-article

(incidentally, this matches the style of Url this blog now uses)

*options used in first Url : Url Master – spaces replaced with hyphens, converted to lower case, no page extensions.  News Articles Friendly Url Provider – ‘Article Style’ Urls, Don’t show DNN Page path in Url.

** options used in second Url : as per first Url, but using ‘Blog Style’ Urls instead of ‘Article Style’

Other News Articles Urls

Of course, the articles Urls aren’t the only ones.  There are Author Urls, Archive Urls and Page Urls.

Page Urls

Page urls are for when you have more than one page in your Article.  You have a choice here – either go with the unique title of the page, like this:

http://example.com/the-second-page-of-the-article , or go with a page numbering scheme, like this : http://example.com/the-title-of-the-article/p/2

The choice is yours – either go for a simple page numbering scheme, or create specific unique page Urls to optimise for the content on each page.

Author Urls

With the Author Urls (which list all articles written by a specific author) you change change between using the Author DotNetNuke username or the DotNetNuke displayname.

So you can go from:

http://example.com/newsarticles/tabid/135/articleType/AuthorView/AuthorId/13/bjones.aspx

to

http://example.com/news-articles/bob-jones  or http://example.com/news-articles/bjones

Archive Urls

Archive Urls show the articles by their creation date.  Normally, you’d expect to see something like this:

http://example.com/newsarticles/tabid/135/articleType/ArchiveView/dateType/Month/year/2011/month/12/default.aspx

Too long!  How about:

http://example.com/2011/12

Now that’s short and sweet!

How does it work?

Well, it’s simple really.  Assuming you’ve already got the Url Master module installed and configured, you just install the News Aricles Friendly Url Provider via the DotNetNuke extensions.   Activate the provider using the Admin->Portal Urls page, and then choose your options using the built-in provider Settings page:

News Articles Friendly Url Provider Settings Page

Using this page, you just choose the different Url options for each page in your portal that has a News Articles module on it, apply the changes, and the Urls are instantly transformed.

What about my existing Articles?

The News Articles module has been around for a while, and there are many thousands of articles out there on the web already written.  Some have been around for a long time.

The last thing you want to do is break the Urls for these old articles, some of which have good search engine rankings.

Of course, implementing this provider doesn’t stop those old articles from working.  They’ll still work as intended.  But you’ve got some options.

Firstly : you can activate the ‘Redirect ‘old’ style Urls to newer Urls.  So if you implement the provider, all your ‘old’ Urls will be redirected across.

Secondly : you can choose which article the new Urls will start from.  By default, this is id 0 – as in, all articles will use the new Ids.  But you can enter your last article created (say, 145) and then any article from 146 onwards will use the new format, and earlier articles will keep using the standard format.   This prevents having changes to existing articles and large-scale 301 redirects implemented and leaves articles ranking well in search engines as they are.  Naturally, the redirect functionality works with the starting Article ID.

Where to get the News Articles Friendly Url Provider

The News Articles Friendly Url provider is available from the News Articles Friendly Url Provider product page.  This is a licensed module, prices start from $30, but you can get a free Trial Licence by going to the licensing page.   That will give you the ability to install the provider, try it out and decide whether you like the new Urls.

Online help for the module is provided through the News Articles Friendly Url Provider Knowledge Base.

The News Articles Friendly Url Provider is shown at the Url Master demonstration site

Comments, Questions

This is a brand-new module hot off the coding bench, so if you have any comments or questions, please feel free to leave a comment below.

Tags:
Categories:
Location: Blogs Parent Separator Crafty Code

3 comment(s) so far...


Gravatar

Re: Improve Urls for the Ventrian News Article Module with the News Articles Friendly Url Provider

Bruce, this is terrific! I'll be implementing this on dnnOsphere ASAP and certainly see using this as a nice way to migrate articles to NA from SubText for my employer...but retain/manage/improve the url structures.

By Steven Webster on   Saturday, January 07, 2012 12:36 AM
Gravatar

Re: Improve Urls for the Ventrian News Article Module with the News Articles Friendly Url Provider

Also, now we need to get you to write a provider for Ventrian's Property Agent! That would be amazing.

By Steven Webster on   Saturday, January 07, 2012 1:40 AM
Gravatar

Re: Improve Urls for the Ventrian News Article Module with the News Articles Friendly Url Provider

@Steven Property Agent provider is in the planning stages.

By Bruce Chapman on   Saturday, January 07, 2012 7:59 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
Bruce Chapman
Hi, I'm Bruce Chapman, and this is my blog. You'll find lots of information here - my thoughts about business and the internet, technical information, things I'm working on and the odd strange post or two.

 

Share this
Get more!
Subscribe to the Mailing List
Email Address:
First Name:
Last Name:
You will be sent a confirmation upon subscription

 

Follow me on Twitter
Stack Exchange
profile for Bruce Chapman at Stack Overflow, Q&A for professional and enthusiast programmers
Klout Profile