As it turns out, not everyone likes Joomla!'s URLs with the fancy numeric key appended to the front of the slug. There are a number of SEF URL Extensions that take difficult approaches to implement more attractive addressing. Some hack core, or create table structures to store key fields and URLs, or other heavy processing.

As with most things Joomla!, you can override Joomla!'s Router and create your own URLs for various Components you use. Here is an example System Plugin that overrides the Router. It runs onAfterInitialise and attaches a Build and Parse Function that you can use to get started.

Understand, this Plugin makes changes to the Current Menu and Parameter values for purpose of showing possibilities. After installing and enabling, you'll find that Frontend navigation doesn't do what you expect. That's intentional to show you how to override the Router. Think of it as a example - change it to what you need.

This is also a good place to trap those old URLs and automate 301 redirects. There is an example of that, as well.

Note: I am sharing this extension using a box.net account. You can create a free account and add the app to your Profile page and upload and share files. The app provides a URL useful for forum posts and the box.net object enables you to store all of your shared files at one location.

Views: 159

Replies to This Discussion

Dear Amy,

I'm searching for this for a long time. I'm trying to customize to override com_content router by system plugin without modified Joomla! core but not successful. Then I found your post here and it seems like what exactly I'm looking for. Unfortunately, the link to your file at box.net is dead. Could you please provide this file again?

Thank you very much.
Keerati S.

Hey Keerati -

 

Take a look at the Overriding Joomla post to see if the sample plugin I shared there might help. It was created early on in Joomla 1.6 so it might need updating. It should have an example for URLs, too.

 

Let me know if that helps. If it doesn't, we can find you what you need.

 

Amy

Dear Amy,

Thank you very much for your reply.

Unfortunately, I cannot access your file sharing via your provided url. It shown Nginx Error 404 Not Found. I tried to register to box.net but also not success "Sorry, signup is closed". I found Molajo project by chance in slideshare, it quite an impressive project and presentation. So, I downloaded Override system plugin since last night before I post on this topic. It seems like it just a little bit too complicate to me. So, I think this Router Override System Plugin would be more simplify to me and fit exactly to what I need.

Since I can't access to your box.net shared link, if possible to send this plugin to me by email sexdrum@gmail.com would be highly appreciated. In case that if I'm still too dull to understand it, I might come back to ask your advise again.

Thank you very much.

Keerati S.

oh - cool - YOU are sexdrum. That handle I know. :)

 

Molajo will be much more cool when we FINALLY finish it. We continue to work on it every single day - getting closer all the time - it's on github if you want to follow.

 

OK, give me a day and I'll try to get a URL override plugin for you. I'm assuming 1.7, but maybe you are thinking 1.5? Which you do need.

Wow! It seems like my name sexdrum is easy to remembered. lol

In year 2007 I started my name iBualoy when I started Joomla! and I intend to use as internet name for web developing. sexdrum is actually my handle since year 2000 during ICQ era. During the Social Media booming in Thailand in the past few years, most of geeks didn't recognize my real name, my nickname, but it seems that "sexdrum" has a strong influence by its own. lol now the Joomla Thai community recognize me as sexdrum.

Unfortunately, most of my production sites are Joomla! 1.5, and there is no plan to migrate to 1.6 in the near future. According to @joomlacorner, he recommend to wait for Joomla 1.7.

Actually my idea is to create Article ID SEF... it quite opposite from the others are trying to do unicode SEF. Because I'm handling Thai users and Thai contents with Thai language and Alphabets. In the real production environment, the web moderator have to create article title in Thai, and SEF generator are most likely broken for this. It even worse in term of SEO, very ugly link when copy it, etc. Another unforeseen difficulty is, when the users change the title, then alias has not synchronized anymore, or the permalink also changed as well.

Unbelievable that just to remove article alias from article slug seems to be so difficult. My personal thinking is it should be available in the Joomla! core just like Wordpress. Anyway, What I did in the past year is modified the /components/com_content/router.php to get rid of slug from $query['id']. Now I'm trying to write the system plugin to do this function instead of hacking Joomla! Core.

With this Article ID SEF idea, the only function I need to override is ContentBuildRoute. I tried to do some way follow this method - Did you know? Overrides are not just for HTML!. But I failed with Fatal Error: redeclare function ContentBuildRoute.

To make long story shorter, yes maam I prefer Joomla 1.5.

Thank you very much in advance.
sexdrum [this name would be better lol]

Dear Amy,

I'm quietly waiting for your mercy ^^

BR

sexdrum

Not too quick, but here is the answer for 1.5. :)

 

http://www.bzzzz.biz/blog/joomla/override-joomla-1.5.-component-rou...

RSS

Badge

Loading…

© 2012   Created by Amy Stephen.

Badges  |  Report an Issue  |  Terms of Service