Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#436 2009-02-12 18:23:19

sewm
New Member
From: Toronto, Canada
Registered: 2004-05-08
Posts: 9
Website

Re: gbp_permanent_links

I found the solution on the Joyent wiki so I’ll post some links here in case it helps someone else in the future.

Enabling Textpattern Plugin decompression on a Joyent Shared Accelerator:

Offline

#437 2009-02-26 17:48:57

Agogo
Member
From: Sthlm, Sweden
Registered: 2008-11-27
Posts: 31

Re: gbp_permanent_links

This plugin sure is great! (Though I have yet to understand all its possible usage)

Ive ran into one problem though. When using <txp:newer> and <txp:older> is spits out mydomain.com instead of lets say www.mydomain.com. This is a problem in this case cause the site has got many subdomains and display content relatively to the subdomain.

When the <txp:newer> and <txp:older> spits out a link without the prefix of the URL and thus the content is wrong.

Im using v 0.13

PS. Also it seems that, in some cases, something goes wrong when the sufix (or subdomain) is entered into the URL. For example: mydomain.com/section/category/ displays the correct content while www.mydomain.com/section/category/ gives me an wierd errorpage.

Offline

#438 2009-03-04 04:58:42

dressedinvalue
Member
From: Louisville, KY
Registered: 2008-12-31
Posts: 21

Re: gbp_permanent_links

Hey y’all. I’m knewish to Textpattern, working to move my site to it from WordPress. I need to keep my WP url’s intact, and it appears this plugin will do the trick, but it doesn’t work on my test site.

Current URL structure: domain.com/2009/02/title

I setup a link rule that says year/month/title for anything in the journal section, but nothing happens.

What should I expect? Any other tricks/settings I should know about?

Offline

#439 2009-03-04 15:15:05

qrayg
Member
From: USA
Registered: 2004-08-27
Posts: 81
Website

Re: gbp_permanent_links

Is your default url scheme set to messy? If not try that…

Personally, I’ve never been able to get the section specific features to work at all. Supposedly this plugin is getting a complete overhaul and will fix a lot of the broken features. The author is extremely busy and we haven’t heard when this new version will be released. IMO the url functionality of this plugin should be merged into TXP since it’s so useful.

Offline

#440 2009-03-04 15:39:38

dressedinvalue
Member
From: Louisville, KY
Registered: 2008-12-31
Posts: 21

Re: gbp_permanent_links

Aha! It’s the Conditions that do not work. :/

Offline

#441 2009-03-10 07:56:27

alex.bignell
New Member
From: Santa Cruz, CA
Registered: 2009-03-10
Posts: 1
Website

Re: gbp_permanent_links

It’s been a while since I ventured into these forums (so long that I had to register a new username). But I had to add a comment to this thread:

This is the most amazing plugin I have ever encountered, for any content management system. The number of potential uses for it, the ease of use—it boggles the mind. I don’t know if you’ll get a chance to read this, Graeme, but I just wanted you to know how awesome you are.

Offline

#442 2009-03-13 13:03:48

isellsoap
New Member
Registered: 2009-02-03
Posts: 2

Re: gbp_permanent_links

Hi there!

I want to omit the first slash of a link, so /section/title should be section/title. Can someone tell me how to do that? Thanks!

Offline

#443 2009-04-01 13:19:26

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

Hi, after long way with testing and setting new site is near finish, but I have one last problem, I cannot paginate on frontpage (section = default) because rule number 6 override it even if I don’t see here match. So pagination on frontpage looks like this: http://dev.ovsem.net/kategorie/3/ insted of http://dev.ovsem.net/3/

First I explain rule number 6: (rest of rules you can see below in debug)

kategorie/(.*)/page/

which is text/regular/page number

the word “kategorie” (first parametr – text) is czech translation of category – I tried many ways how to run pagination on category page (eg. http://dev.ovsem.net/kategorie/internet/2/ (which means page number 2 list of article form category1 (internet) in category listing. And the rule above is the only one how can I make pagination work on category listing. Regular expression replace name of category (because in category listing I cannot use category1 or category2 – because article can be assigned to both categories).

But this rule conflicts with pagination on frontpage (http://dev.ovsem.net/3/)

So i tried to set a new rule number 7: page/ (only page number) to override rule number 6 with higher precedence but still highest match is for rule number 6 on frontpage.

Maybe to rule number 6 can be set with a different way, but I don’t know how. “category” maybe should be a new component type – not category1, category2, but default category, which is used automatically in txp (domain.com/category/name-of-category) where it “replace” non-existing category “section”.

If anyone can help, I let debug on (due to this debug mode design is little bit messy in stupid IE).

Any help will be appreciated (with MONEY DONATION)

Below is debug code from url http://dev.ovsem.net/

<!— Plugin: gbp_permanent_links – 0.13 —>
<!— Function: _textpattern() —>
<!— Request URI: / —>
<!— Loading permlinks from db —>
<!— 1: Online hry (section/category/title/) —>
<!— 2: Straknovani ve hrach (section/category/page/) —>
<!— 3: Stránkování v sekci (section/page/) —>
<!— 4: Default URL (section/title/) —>
<!— 5: Výsledky hledání (section/search/page/) —>
<!— 6: Strankovani v kategorii (kategorie/(.*)/page/) —>
<!— 7: Titulka (page/) —>
<!— Permlink name: Titulka —>
<!— Permlink id: 49d35f45d389c —>
<!— Preview: page/ —>
<!— PL component count: 1 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>

<!— Permlink name: Online hry —>
<!— Permlink id: 499eff89c973e —>
<!— Preview: section/category/title/ —>
<!— PL component count: 3 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— Permlink name: Default URL —>
<!— Permlink id: 49ba9eac6e41b —>
<!— Preview: section/title/ —>
<!— PL component count: 2 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— Permlink name: Straknovani ve hrach —>
<!— Permlink id: 49d35476732ae —>
<!— Preview: section/category/page/ —>
<!— PL component count: 3 —>
<!— URL component count: 1 —>

<!— More URL components than PL components —>
<!— Permlink name: Strankovani v kategorii —>
<!— Permlink id: 49d354d5ddab9 —>
<!— Preview: kategorie/(.*)/page/ —>
<!— PL component count: 3 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— Permlink name: Stránkování v sekci —>
<!— Permlink id: 49c1236a8daac —>
<!— Preview: section/page/ —>
<!— PL component count: 2 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— Permlink name: Výsledky hledání —>
<!— Permlink id: 49c1217cb6904 —>
<!— Preview: section/search/page/ —>
<!— PL component count: 3 —>

<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— Permlink name: gbp_permanent_links_default —>
<!— Permlink id: default —>
<!— Preview: / —>
<!— PL component count: 0 —>
<!— URL component count: 1 —>
<!— More URL components than PL components —>
<!— NO CHANGES MADE —>
<!—
url: ?pg=1
path: index.php
query: pg=1
pg: 1
Testing permlink: Titulka – 49d35f45d389c
Preview: page/
Match count: 0
Testing permlink: Online hry – 499eff89c973e
Preview: section/category/title/
Match count: 0
Testing permlink: Default URL – 49ba9eac6e41b
Preview: section/title/
Match count: 0
Testing permlink: Straknovani ve hrach – 49d35476732ae
Preview: section/category/page/
Match count: 0
Testing permlink: Strankovani v kategorii – 49d354d5ddab9
Preview: kategorie/(.*)/page/
Match count: 0
New highest match! kategorie/
Testing permlink: Stránkování v sekci – 49c1236a8daac
Preview: section/page/
Match count: 0
Testing permlink: Výsledky hledání – 49c1217cb6904
Preview: section/search/page/
Match count: 0
Testing permlink: gbp_permanent_links_default – gbp_permanent_links_default
Preview:
Match count: 0
a:2:{i:0;s:9:“kategorie”;i:1;N;}
http://dev.ovsem.net/kategorie/1/

Last edited by beztak (2009-04-01 19:04:24)

Offline

#444 2009-04-02 22:33:08

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

beztak wrote:

Hi, after long way with testing and setting new site is near finish, but I have one last problem, I cannot paginate on frontpage (section = default) because rule number 6 override it even if I don’t see here match. So pagination on frontpage looks like this: http://dev.ovsem.net/kategorie/3/ insted of http://dev.ovsem.net/3/

Should be fixed in version 0.14 (Compressed) – love the site design btw

Last edited by graeme (2009-04-02 22:34:04)

Offline

#445 2009-04-02 23:12:38

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Should be fixed in version 0.14 (Compressed) – love the site design btw

Nice to here you like design. Thank you.

So frontpage is now ok, but category listing pages cannot paginate, e.g.: http://dev.ovsem.net/kategorie/software/
Links are going back to homepage. I set precedence for the 6 rule to “1”, the rest is “0”.

If you want I would send you a login/pass to this site. And as I promise I would like to give you some money for your help. I’m so happy I can launch officially this new site after resolving this.

Offline

#446 2009-04-02 23:47:03

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

beztak wrote:

So frontpage is now ok, but category listing pages cannot paginate, e.g.: http://dev.ovsem.net/kategorie/software/
Links are going back to homepage. I set precedence for the 6 rule to “1”, the rest is “0”.

Okay– i’ve recreated the v0.14 download. Please try it again – this time there is a new preference (text_and_regex_segment_scores) option which defaults to zero for backwards compatibility. Basically the text and regular expression segments have never been counted when calculating which rule to use (there was a good reason for this at the time but I can’t remember what!) – if you set it to 1 and you should be good to go.

Edit: There seems to be one last problem – which unfortunately is not as easy to fix. On the second page, the link back to page 1 is incorrect. There should be a way to fix this but I’ll have to sleep on it

Last edited by graeme (2009-04-03 00:14:59)

Offline

#447 2009-04-03 07:07:28

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Okay– i’ve recreated the v0.14 download. Please try it again – this time there is a new preference (text_and_regex_segment_scores) option which defaults to zero for backwards compatibility. Basically the text and regular expression segments have never been counted when calculating which rule to use (there was a good reason for this at the time but I can’t remember what!) – if you set it to 1 and you should be good to go.

It seems it’s not working. So I send you in PM login/pass to my site. Thank you in advanced.

Edit: There seems to be one last problem – which unfortunately is not as easy to fix. On the second page, the link back to page 1 is incorrect. There should be a way to fix this but I’ll have to sleep on it

I see this problem, but it’s working, so this can be resolved later ;)

Offline

#448 2009-04-03 09:43:24

graeme
Plugin Author
Registered: 2004-06-21
Posts: 337
Website

Re: gbp_permanent_links

beztak wrote:

It seems it’s not working. So I send you in PM login/pass to my site. Thank you in advanced.

Right I think it is sorted – I’ve made some small change to the plugin code on the site (I will release it later.. once I get home) and I’ve increased the precedence of your /page rule. Can you make sure it is working as expected?

Offline

#449 2009-04-04 08:12:42

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: gbp_permanent_links

graeme wrote:

Right I think it is sorted – I’ve made some small change to the plugin code on the site (I will release it later.. once I get home) and I’ve increased the precedence of your /page rule. Can you make sure it is working as expected?

It’s working like a charm. Thank you very much.
Rest in PM.

Offline

#450 2009-04-05 12:26:11

hoho
Plugin Author
Registered: 2009-04-05
Posts: 11

Re: gbp_permanent_links

graeme wrote:

Should be fixed in version 0.14 (Compressed)

Greame, thanks for the plugin and for providing great support, first of all. Only a pity there is no documentation and one has to learn by trial-and-error or reading through this lengthy, unstructured thread.

Trying to configure the plugin for my site, I’ve come to some issues you might find worth your time.

1) Newlines are gone in the compressed 0.14 version making tweaking almost impossible. Or is it part of the compression? Anyway, despite having full access to server configuration, haven’t managed to install uncompressed version by any means :( so newlines in the compressed version would come in handy.

P.S. post_max_size = 8M and upload_max_filesize = 10M seem fairly enough for a 80k plugin but it always gets truncated upon upload.

2) I need an article ‘article-title’ in categories ‘cat1’ and ‘cat2’ to be accessible via URLs
example.com/article-title
example.com/cat1/article-title
example.com/cat2/article-title

This can be done with the plugin. However, I also want <txp:permlink/> to be context sensitive and preserve the category whenever possible. That is, being in a category ‘cat1’ and linking an article in ‘cat1’ I want the URL be /cat1/title. Being in a category ‘cat1’ and linking an article not in that category, I want the URL be just /title. Finaly, having selected no category and linking an article in whatever categories, I still want the URL be just /title.

I didn’t find a way to achieve this behaviour in the current implementation – it seems to be context insensitive and tries to generate always the same permanent link no matter where we are in the web tree, a contra-intuitive behaviour to me when it comes to categories.

I have tweaked the ‘category’ section in the _permlinkurl function (from line 772 of the uncompressed version) as follows

case 'category':
  if (!@$pl_c['category']) $pl_c['category'] = 1;
  $primary = 'category'. $pl_c['category'];
  $secondary = 'category'. (3-(int)$pl_c['category']);
  if ($$primary == $pretext['c']) $uri_c = $$primary;
  else if ($$secondary == $pretext['c']) $uri_c = $$secondary;
  else {
    unset($uri);
    break 2;
  }

It seems to do what I want :) – I’m no expert in PHP, just using my general hacking skills. Would it be possible to include this behaviour in the plugin, please?

3) Why is “Permanent Links” tab not available from the “Plugins” tab? It was real pain in a body part fighting the truncation and then tweaking the plugin. :)

Offline

Board footer

Powered by FluxBB