Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-03-08 13:39:18

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

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

#14 2005-03-09 00:54:37

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

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.


BB6 Band My band
Gud One My blog

Offline

#15 2005-03-09 15:30:41

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

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

#16 2005-03-09 15:34:06

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

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

#17 2005-03-09 16:06:47

Marek
New Member
From: Prague, Czech Republic
Registered: 2004-12-12
Posts: 7
Website

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

#18 2005-03-09 19:35:52

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

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

#20 2005-03-11 10:27:45

micampe
Archived Plugin Author
From: Treviso, Italy
Registered: 2005-03-07
Posts: 38
Website

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

#21 2005-03-11 21:07:22

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

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!


BB6 Band My band
Gud One My blog

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

#23 2005-03-13 09:58:39

micampe
Archived Plugin Author
From: Treviso, Italy
Registered: 2005-03-07
Posts: 38
Website

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

#24 2005-03-13 17:27:10

sungodbiff
Archived Plugin Author
Registered: 2004-03-23
Posts: 57
Website

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

Board footer

Powered by FluxBB