Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Brilliant sgb! Just built a new site using the plugin and the mods to get section/title URLs. I really wish this was included in the base code.
One tip in case anyone else trys to do the same. When working in section/title mode, the standard if_article_list and if_individual_article tags don’t work but the tcm_if plugin does the same thing for you.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
It’s working great for me now. Must have been server problems last night.
Would it be possible to redirect to a custom 404 page if the page is not found? Unfortunately, it redirects to the home page. For me this is a problem because it makes the home page contents sit on top of my ‘other pages’ background and divs which breaks it all up and looks a real mess.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Gustaf –
I definitely see your problem not, I’m poking around a bit with the best way to add this. Work’s got me pretty backed up through the week but I should be able to get back to it this weekend so I’ll post an update Sunday if I come up with anything clever :)
Perhaps in the interm you could try my modifications (see the second link in my first post) and add permlink support for /section/category/title style links. I think that would solve your problem.
- sgb
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Wilshire -
Thanks for the kind words!
Zero -
I’m working on a companion plugin “sgb_error_documents” to add this feature to TxP. I should have the kinks worked out and posted this weekend. An update to sgb_url_handler will automatically use sgb_error_documents if it is available. The errors will be customizable and will be triggered if an article, section, category are not found.
- sgb
Last edited by sungodbiff (2005-03-09 15:34:18)
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
What exactly the plugin does? Does it redirect (301) from all URL variants to the preferred one, or simply display the same duplicate content on many different URLs?
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Marek -
It does not issue a redirect. It allows content to be accessible through any of the supported URLs.
- sgb
Offline
#19 2005-03-11 02:10:03
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
“I’m working on a companion plugin ‘sgb_error_documents’ to add this feature to TxP.”
Oh good! I discovered the same thing as zero: if I visit a “sub-page” that isn’t there, it shows that section’s default page. I’m looking forward to this addition.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
This plugin is just great. I had reached the same effect by hacking into publish.php, but your plugin is much better. I too look forward your error documents plugin.
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
Mary, I actually like the way it redirects to site/section/ when I typed in site/section/wrongaddress. However, I don’t like it if I type site/wrongaddress and it redirects me to site/. That’s when I want a custom 404.
Great plugin, those clean urls make design a lot easier!
Offline
#22 2005-03-11 23:16:17
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
bloody marvellous!
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
I have a bug and fix: if I have two articles with the same title in different sections and write a /Section/Title URL, the plugin can match the wrong URL, as it uses the lookupByTitle() function, wich doesn’t takes sections into account.
My fix is to add this function to the plugin:
function lookupBySectionTitle($where,$title,$debug=’‘)
{
return safe_row(“ID,Section”,“textpattern”,
“section like ‘”.doSlash($where).”%’ and url_title like ‘“.doSlash($title).”’ limit 1”);
}
and then use it to lookup /Section/Title style URLs.
Will have to check if this is a problem for TXP too…
Offline
Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time
micampe -
Damn. You ruined my surprise! :)
I also noticed at also when I was initially developing this plugin. It was on my todo list for version 0.1.4. Which I should hopefully have posted some time today. This version will also support basic 404 functionality through my sgb_error_documents plugin (which will be released when I update this one).
0.1.4 will use sections whenever available to assist in locating the correct article. It won’t do much good for /Title URLs.
Good eye though!
- sgb
Last edited by sungodbiff (2005-03-13 17:29:01)
Offline