Class to create page links

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
10/27/2008 10:06:16 AM
Nux
Gravatar
Total Posts 183

Class to create page links

Hey Joe,

I just discovered your cms, and I must say that I really like it.
A few year ago, I started the same thing. I used the same project as basis and extended that with url rewriting and things like that. But I stopted working in it, because I become daddy :) So now i'm focussing on yours :)

And I'm impressed. But there is one thing that I think would be a really nice extention for this cms: use of a class that reads a config file were all links are "build" I saw this in Community Server and I have used it also in all my sites. That way it is easy to give a nice url to all blog entries or forum entries.

Short explanation: there is a config file with configs like:
<url name="homepage_lang" location="common" format="{0}/default.aspx" pattern="(..)/default.aspx" sendTo="default.aspx?[language]=$1"/>
In my code, I get this config and I let the code make my link. If I want to change one of my links, I just need to change the config.
If this is something you would be interested in, just let me know and I can send you my code to test it.

 

Stef

10/28/2008 5:19:29 AM
Gravatar
Total Posts 18439

Re: Class to create page links

Hi Stef,

We already have url re-writing and friendly page urls in menu pages and in the blog, we don't have it in the forums and I'm not sure its a great idea for forums myself.

We don't use any config files for url re-writing and that does't sound particularly user friendly to me. Ours are managed in the db and from the web ui. They are created for you by default but can be tweaked when creating a page or blog post. The complete list of friendly url mappings is found under Administration Menu > Advanced Tools > Url Manager

Best,

Joe

10/28/2008 5:37:03 AM
Nux
Gravatar
Total Posts 183

Re: Class to create page links

That is correct, but what if I want to make a custom module that make use of the business of MP?

Like, I wanted to make a small overview of my latests blog entries (that I use as a news module) because I want to have
other settings than the news page itselfs. I can use the business to get the data, but I will have to copy your logic
of building the links, since the logic is in the blogmodule.ascx (protected string FormatBlogUrl()).
So I can't get it in my module, so the only thing to do is to copy that code.
Or did I miss something and is there a class whic I can use for that?

Stef
 

10/28/2008 5:50:26 AM
Gravatar
Total Posts 18439

Re: Class to create page links

If you are building a custom feature that will create its own urls then you should implement it like the blog does using the friendlyurl business class. If you are just trying to link to existing posts like in an html module just copy the links either from the browser url bar or right click an existing link and choose copy link location.

If you are making a custom feature I generally recommend that there be no cross talk across features other than consuming a feed or something it exposes. I mean technically in code you could build a custom feature that retrieves data from the blog feature but it may break someday when I make changes to the blog. The blog itself only has to use the url creation logic when creating new posts, it then stores the url along with the post so its not complicated for the blog to build its links, it just uses the url it knows it should use from the db. FormatBlogUrl function you mention is primarily for backward compatibility with upgraded sites that have blog posts created before we implemented the friendly urls in the blog (which was only 3-4 months ago).

mojoPortal content system features should be self contained and have no dependency on other features in my opinion and you should not use business object from one feature inside another. I'm in the process of moving most of the content features like blogs forums etc out of the main core projects so that a very light package of mojoportal can be built to include just the html module and whatever custom features a developer wants to include.

Best,

Joe

10/28/2008 6:03:18 AM
Nux
Gravatar
Total Posts 183

Re: Class to create page links

Joe,

I understand what you are trying to say. So when I have an instance of a blog entry, I also has it's url, correct?

Never thought about it :)

Thanks for the explanation.
Getting more and more excited to use this portal.

10/28/2008 6:10:15 AM
Gravatar
Total Posts 18439

Re: Class to create page links

Yes, thats correct. When a blog post is made it creates a friendly url in mp_FriendlyUrls which is used to by the url re-writer. The re-writer actually re-writes from the friendly url to the real url which is /BlogView.aspx?pageid=x&mid=y&ItemID=z, but the friendly url is what is shown in the browser. After creating the friendly url the blog stores the same url along with the entry so it doesn't have to look anywhere else to know the url for creating its own internal links to a post.

Best,

Joe

10/28/2008 6:57:56 AM
Nux
Gravatar
Total Posts 183

Re: Class to create page links

Thanks Joe

You must sign in to post in the forums. This thread is closed to new posts.