Quick Nav:  Online Store   |   Login | Register

Rules for DNN Blog Entries

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Briana Tarrance
<20 Posts
Posts:12


07/23/2007 4:24 AM  

Is there any way to add a rule for DNN Blog Module Entries to be displayed with a page name instead of entryID=4, for example? I checked the rules sticky page and didn't see anything. Thanks very much in advance

John Mitchell
Posts:3492


07/23/2007 10:01 AM  

Hi Briandus,

Can you show me what the Url looks like before, and what you would like for it to look like after the replacement is done?

eoghan o'neill
<50 Posts
Posts:38


07/30/2007 7:59 AM  

 

I have a similar (same?) need to what Briandus has outlined above. For example, the following URLs link to the same blog entry on my DNN website.

The title of this blog entry is 'Wrecking Ball For Beijing Club' (this title is stored in a field in the DNN SQL 2005 database). What I would like is for the URL to include the blog entry's title so that it looks something like this:

  • http://www.cluas.com/indie-music/Blogs/Beijing_Beat/Wrecking-Ball-For-Beijing-Club.aspx 
  •        or
  • http://www.cluas.com/indie-music/Blogs/Beijing_Beat/Wrecking-Ball-For-Beijing-Club/Default.aspx 

By introducing the blog title into the URL (as is the best practice of other leading blog platforms) it greatly improves the URL in the eyes of the serach engines - as the URL contains unique, meaningful textual information that is highly relevant / indicative of the rest of the content on the page.

Can this be done?

Eoghano

jpstuddard
<20 Posts
Posts:3


08/28/2007 11:36 AM  

Jjust stumbled across PageBlaster and rewritting the BLOG url is exactly what I was looking for. Has anyone made any progress on this with PageBlaster.

John Mitchell
Posts:3492


08/28/2007 10:36 PM  

Ok, sorry it took me so long to get to this, but I think I have an answer.  I actually have two.

For a simple replacement rule you could use this:



SearchFor:  <a(.*?Blog.*?href=.*?)Default.aspx">(.*?)</a>

ReplaceWith: <a$1$2.aspx">$2</a>

If you want to get rid of the spaces between the words in the url and replace them with dashes you can do it with two rules like this:



SearchFor:  <a(.*?Blog.*?href=.*?)Default.aspx">((\w+)\W(\w+)?\W?(\w+)?\W?(\w+)?\W?(\w+)?\W?(\w+)?\W?(\w+)?\W?(.*?))</a>

ReplaceWith: <a$1$3-$4-$5-$6-$7-$8-$9.aspx">$2</a>

This second option grabs up to 7 words from the subject title and replaces default.aspx as the page name. With this option you may have extra dashes at the end of your page names if you have a subject with less that 7 words, so you can also add another rule to execute after which will remove the extra dashes. It will look like this:



SearchFor:  -+a?-?t?d?\.aspx
ReplaceWith:  .aspx

jpstuddard
<20 Posts
Posts:3


09/03/2007 5:56 PM  

John,

Thanks for the reply. I have purcahsed and installed PB and it is working great so far. I have created some Portal rules (basic URL rewrite type stuff) and am now working with some page rules on my blogs. I implemented the above samples and it is working as advertised. The one issue I ran into with the last replace (removing the extra dashes) is that it leaves an extra space before the .aspx (here is a sample: http://www.rantinstitute.com/personal-rants/tabid/57/EntryID/19/Alberto-Gonzalez-finally-resigns%20.aspx). I'm new to regex and am pretty much getting my rear-end kicked trying to fix the space. Any help would be greatly appreciated.

Also, do you have any ideas on how to grap the blog title on the blog main page and get it into the url. He is an example:

http://www.rantinstitute.com/personal-rants/tabid/57/BlogID/4/Default.aspx

I would like to change "/BlogID/4/Default.aspx" to "the-daily-rant.aspx"  (Which is the Blog title) but I don't know how to pull it in and am struggling with regex code at this point. If possible I would like it to pull it in dynamically to avoid hard coding it anywhere (like in the siteurls.config).

Thanks,

John Studdard
www.rantinstitute.com

 

John Mitchell
Posts:3492


09/04/2007 11:57 AM  
I don't know for sure, but my guess would be that you have the space in front of the period in the ReplaceWith field. It's kind of hard to show it without a space in the post but make sure that the replacement is just ".aspx" (without the quotes)
jpstuddard
<20 Posts
Posts:3


09/04/2007 12:48 PM  

Posted By John Mitchell on 09/04/2007 11:57 AM
I don't know for sure, but my guess would be that you have the space in front of the period in the ReplaceWith field. It's kind of hard to show it without a space in the post but make sure that the replacement is just ".aspx" (without the quotes)

I just checked and there is not a space. Here is what my rule looks like.

 

John Mitchell
Posts:3492


09/04/2007 12:56 PM  
I don't see the space in the output on your site now, so you might have fixed it.

I'll see if I can come up with a way to grab the other title you are looking for next.
Ari Doucette
<100 Posts
Posts:58


10/02/2007 5:48 AM  
This rule looks like it is for hyperlinks in pages? (the "a" tag)
Is there a rule that would put the title for the Blog entry into the URL for the page? To make it more search-engine friendly?
This would be a great thing for Wiki and Forum posts, as well as the Blog posts.
Thanks,
Ari
John Mitchell
Posts:3492


10/02/2007 12:05 PM  
Hi Ari,
When you say "into the URL for the page", I'm not sure what you mean. Are you saying that you would like to be able to use that Url and have it pull up the desired entry?
If so, then you can do that as long as you include the other parameters that DNN and the module need like tabid, entry id, etc. as shown above.
In other words, it doesn't matter what the name of the page is in the Url as long as you have the other required parameters.
Ari Doucette
<100 Posts
Posts:58


10/02/2007 12:29 PM  

What I would like to do is put the title of the Blog, Wiki or Forum entry into the url of the page it is viewed on.
For example, I currently have a Blog entry at the url http://www.mysite.com/tabid/176/EntryID/4/Community/Blogs.aspx (note this is already using a nifty PageBlaster rewrite rule ). Since the Blog modules all appear on the same DNN tab, the EntryIDs just change what the modules on the tab display. The Blog is titled "Blog Title" and the Blog Entry is titled "Entry Title".

How can I get the url be something more like http://www.mysite.com/tabid/176/EntryID/4/BlogTitle/EntryTitle.aspx ? That would be really sweet!

Also, I wonder about a similar thing for the DNN Wiki module -- putting the Wiki entry title into the page url?.

And, while we're on the topic of the Blogs and the Wikis, is it possible to also rewrite the "title" tag in the head of the page to have the "Blog Title: Entry Title" or the "Wiki entry title" in it?

I'm using the free page-blaster. If this is easier in the paid version, I'd be happy to use this as my excuse to the boss for upgrading .

Thanks,
Ari

Ari Doucette
<100 Posts
Posts:58


10/07/2007 8:12 AM  

All right, Here's teh answer. (John replied to this by email and I'll post it here)

For the Blog - the Blog entry title is already in the page title, just not the Blog title. With Forums (I'm using ActiveForums), the thread title is already in page title.

For Wiki entries, here's a page rule to get the Wiki Entry Title into the Page Title.

I couldn't spend any more time trying to figure out how to get html code to appear here, so I just attached it as an image file.

 






Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Rules for DNN Blog Entries



ActiveForums 3.7
Powered by: Snapsis Software