Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#256 2005-08-10 18:39:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Andrew, Sencer has listed a number of things to be sorted and the 404 problem, which I also think is a must, is listed but I have to think as of today that it probably won’t be fixed for 1.0 unless there is a good deal of behind-the-scenes work going on.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#257 2005-08-10 19:35:41

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Man, I just can’t keep up with the volume of discussion going on here lately – thanks for that link. And cheese for all!

Offline

#258 2005-08-10 20:41:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Can anyone explain why sgb_url_handler is redirecting my old section/id/title url schemes to the new section/title scheme perfectly, and producing 404s, and without errors (at least in production statuses live and testing), in RC5, on three sites?

I’m beginning to think there is something terribly wrong with my sites if this plugin is working…

Offline

#259 2005-08-10 20:57:29

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

I, too, wondered why Jon and I (on different hosts) are getting errors when you seem to have it working fine. It’s been stated this plugin hasn’t been updated for RC5, so there’s no telling why it works for you and not for us.

In terms of fixing this permanently within some 1.0+ release, I’d wondered if it would make it any easier (i.e., quicker to implement with less testing) if you could specify in the preferences not only your preferred current URL scheme, but also the URL scheme you were using previously that you’d like to redirect. I don’t know if removing some variables in that way would make it less complex to code or not.


TextPattern user since 04/04/04

Offline

#260 2005-08-12 20:20:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Finally managed to find a problem with this plugin ;)

I just started using the file download functionality, and found that the download links (e.g. /file_download/2) returned my 404 article. Tried all kinds of things that made no difference, but in the end I found that changing

$config[‘match’] = ‘exact’;

to

$config[‘match’] = ‘best’;

got the download links to work. This however also means that /section/id/title urls are not redirected any longer to /section/title (though both schemes are working now), and something like /section/non-existing-title is leading to the section frontpage instead of to the 404 article.

So, I can live with this, but if there is a way to keep the ‘exact’ match as well as have working download links, I’d love to hear it.

Offline

#261 2005-08-12 22:16:28

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Well you seemed to be the only one without problems Els. I was wondering what you were doing wrong. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#262 2005-08-12 22:40:07

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

thebombsite wrote:

I was wondering what you were doing wrong. :)

So was I. Still am actually…

Offline

#263 2005-08-15 17:41:31

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Anyone have this working in 4.0 yet? The error messages are gone for me now. But I cannot figure out how to get the url mode working again. I am trying to enable the section/category/title urls I had, but the link urls are all falling back to the mode set in the preferences: section/title. This may just be a case of operator error, not understanding how to configure the plugin. Specifically, I don’t know what is meant in the plugin help by using the <txp: /> tag to create the permlinks.

Offline

#264 2005-08-15 17:52:36

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Ah, I see. This makes a whole lot more sense. I should have read the website. <txp: /> is a typo in the plugin help file. The tag for permlinks should be <txp:sgb_url_handler_permlink></txp:sgb_url_handler_permlink>. Works great, except I would rather the permlink output the category name rather than the title.

Offline

#265 2005-08-15 18:33:17

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

You can edit what the permlink returns if you open the plugin code. I don’t know exactly where you can make changes but I’m pretty sure that you can.

Offline

#266 2005-08-15 19:01:14

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

My mistake. The permlink output is working fine, outputting the category name. I just forgot about my modification to output the name of category2 if it existed before output category 1. At around line 276, you can modify the code to look like this if you would rather the plugin output the name of category2:

bc.. $r = array($a[‘url_title’], $a[‘section’], urlencode(((isset($a[‘category2’])) ? $a[‘category2’] : $a[‘category1’])), $a[‘id’], date(‘Y’, $a[‘posted’]), date(‘m’, $a[‘posted’]), date(‘d’, $a[‘posted’]), ‘/’);

Category1 and category2 have been switched around in the code. I always put the more specific category in category2, and I would rather that output in the permlink url.

Offline

#267 2005-08-15 20:22:48

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Well, I’ve got the right permlink form now, but the link is not able to select the right article, though it selects the right category. I suppose Jeremie is right.

It seems the only way the section/category/title url scheme worked for me before was because I had forced Textpattern to recognize it by hacking the source.

Last edited by bauhouse (2005-08-15 20:35:05)

Offline

#268 2005-08-16 08:34:12

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

> Andrew wrote:

> bq. reid wrote: …until there’s a workable way to redirect old schemes to new ones, I’m stuck with /section/id/title.

> That’s precisely the reason why I haven’t switched url schemas since the new formats were made available.
And exactly why I wished I hadn’t rushed in to change over to section/title….


Cheers,
Jon VC#9

Offline

#269 2005-08-16 09:15:07

boblet
Member
Registered: 2005-08-08
Posts: 53

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Hi all, after much flailing around I’ve managed to get section/category/title urls working using v4.0r797. The important things for me were:
  • finding the instructions! (always a good start ;-)
    also, clicking the admin > plugins > help link (to the right of the plugin) actually gives a decent help page.
  • following the guide to hacking in support for this scheme:
    • note that where he’s written he added section_title I think he means he added section_category_title, as section_title is already present.
    • Also note there’s no language text files anymore, and you’ll need to add a new row to the database’s txplang table. I duplicated id#342 name=section_title and changed to name=section_category_title and data=/section/category/title (lang and event fields stay the same, hopefully lastmod will automatically have the current timestamp inserted, and you’ll probably need to give it an incremental id)
  • changing the order of preferred url schemes in admin > plugins > edit plugin so that <pre>$schemes[‘section_category_title’] = ‘/%section%/%category%/%title%’;</pre> is at the top of the list
  • changing instances of <txp:permlink> to <txp:sgb_url_handler_permlink> in content > forms and content > pages

have fun

peace – boblet

PS I wonder how to escape % symbols in @ code blocks?

Last edited by boblet (2005-08-16 09:18:13)

Offline

#270 2005-08-16 15:10:46

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] sgb_url_handler - support all url variations at the same time

Thanks for the instructions, boblet. I must still be missing something, though. I’m still unable to select the correct article within the category. One thing I discovered, though, is that you don’t need to modify the database manually if you have a language file in the textpattern/lang directory.

  • I made the modification to the textpattern/lang/en-gb.txt file to add this text to the language file (adding the second line after the first line — line 400):
    <pre>section_title => /section/title
    section_category_title => /section/category/title
    </pre>
  • Go to admin > preferences > manage languages and click on the “Install from file (experts only)” link at the bottom of the page.
  • This should give you a list of the files in the textpattern/lang directory. Click on the “install” link under the column heading “Install from file”. This appears to add a row at the end of the lang table in the database for the additional url scheme.

Offline

Board footer

Powered by FluxBB