Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#181 2005-06-22 18:48:42

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

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

andreas, did you do sgbs recommendations for getting section/category/title permalinks?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#182 2005-06-22 19:06:30

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

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

No, I didn’t. But I thought that they were intended to be used with the original <txp:permlink> tags. But since I use mic_permlink I don’t need this — or am I mistaken?

Offline

#183 2005-06-22 20:27:41

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

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

ok, i’ve never used feeds with txp, but wouldn’t your feeds come out with the default permlink scheme (section/category/title) and solve your problem?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#184 2005-06-22 20:41:28

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

Oh what?! Now something else doesn’t work :(

Links to my category pages look like this: doggiez.nl/rubriek/clickertraining, where ‘rubriek’ is what I have in the language file for ‘category’, and ‘clickertraining’ is the name of the category.

I understood I had to change this:

$schemes[‘_category’] = ‘/% _category%/% category%’;

into this:

$schemes[‘_category’] = ‘/% _rubriek%/% category%’;

but I’m getting 404s. So I must be wrong. But what should I do then?

(I had to add spaces to show the %)

Offline

#185 2005-06-22 23:05:18

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

doggiez -

Actually you don’t need to change anything. Keywords starting with an underscore like &#37;_category&#37; are locale specific, e.g. for my install of TxP (EN-US) &#37;_category&#37; literally translates to “category” while for an install of TxP using Spanish (ES-ES) &#37;_category&#37; literally translates to “categor&iacute;a”.

If you’ve modified you language file and changed your category translation to <code>category => rubriek</code> than &#37;_category&#37; would translate to “rubriek”.

If you haven’t changed your language file and you still want to have category URLs starting with “rubriek” all you need to do is add a scheme like <code>$schemes[‘my_category’] = ‘/rubriek/&#37;category&#37;’;</code> to the config function in sgb_url_handler. In this way rubriek is matched as a literal word and not mapped to any variables.

I hope this helps!

- sgb

Last edited by sungodbiff (2005-06-22 23:08:01)

Offline

#186 2005-06-23 01:30:24

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

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

> sungodbiff wrote:
> ubernostrum –
> sgb_error_documents supports 403s but you need to hook into it (sgb_url_handler doesn’t do any
> authentication stuff). Adding support for 410s would be really easy, but again you’d have to hook your
> authentication code into it.
>
> How are you generating 403/410s?

At the moment I’m not ;)

What I was thinking with the 410, particularly, was that if I delete an article it’s more appropriate to return “410 Gone” than “404 Not Found”; also, that way most search spiders and the like will stop trying to index it. As for the 403, I just thought it’d be handy to have for sites which use TXP’s password-protection features.


You cooin’ with my bird?

Offline

#187 2005-06-23 03:40:55

starzabove
Member
Registered: 2004-04-13
Posts: 76

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

Hi,
First off, sgb, THANK YOU- this solves so many problems for me!

Second, am I missing something? I did peruse pages of posts, but with this new version, should date-based urls also be working now in current versions of rc3?

Thanks!


90+ Textpattern installs and still going…

Offline

#188 2005-06-23 04:59:19

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

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

…but wouldn’t your feeds come out with the default permlink scheme (section/category/title) and solve your problem?

Feeds are generated based on the URL scheme set in the preferences and there it’s not possible to get section/category/title — so all URLs that are generated by TXP instead of by a plugin tag come out as section/title; ideally, sgb_url_handler would translate all these into the proper ones on the fly. It does this in theory but I can’t get it to work for all of my site.

But then, I’ll have to clean up some things URL-wise, perhaps. When I have some spare time I might try to use the new permlink tag of the plugin instead of mic_permlink. Would that make any difference?

Offline

#189 2005-06-23 06:43:55

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

sungodbiff wrote:<br />
doggiez -<br />
Actually you don’t need to change anything. Keywords starting with an underscore like _category are locale specific, e.g. for my install of TxP (EN-US) _category literally translates to “category” while for an install of TxP using Spanish (ES-ES) _category literally translates to “categor&iacute;a”.<br />
If you’ve modified you language file and changed your category translation to <code>category => rubriek</code> than _category would translate to “rubriek”.

Well, I changed it back to the original code, and still got 404s. I’m using the en-gb.txt language file, with just a few modifications.

If you haven’t changed your language file and you still want to have category URLs starting with “rubriek” all you need to do is add a scheme like <code>$schemes[‘my_category’] = ‘/rubriek/%category%’;</code> to the config function in sgb_url_handler. In this way rubriek is matched as a literal word and not mapped to any variables.

Though I shouldn’t have to if I understand you correctly, I added that line of code, and now everything is working fine again.

Thank you again for your help!

[Edit: how on earth do you get the % to display properly on this board???]

Last edited by doggiez (2005-06-23 06:46:10)

Offline

#190 2005-06-23 07:18:27

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

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

andreas, i beg to differ. following sgb’s instructions for customization , i get section/category/title permlinks BY DEFAULT (set in the txp preferences). I promise. Just try it!

Last edited by kemie (2005-06-23 07:19:15)


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#191 2005-06-23 09:26:39

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

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

i beg to differ. following sgb’s instructions for customization , i get section/category/title permlinks BY DEFAULT

I don’t. I’ve tried that before and I have the setting in the preferences but it doesn’t have any effect. If I choose section/category/title there, TXP still produces section/title URLs.

Offline

#192 2005-06-23 09:35:13

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

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

> kemie wrote:

following sgb’s instructions for customization , i get section/category/title permlinks BY DEFAULT (set in the txp preferences).

I still don’t know what that was been inserted into the core code of TXP, and deleted later. Did I miss something ?

Offline

Board footer

Powered by FluxBB