Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#481 2009-08-31 18:55:54

LetterHoofd
Member
From: Kortrijk, BE
Registered: 2006-01-20
Posts: 40
Website

Re: gbp_permanent_links

I have these versions installed

  • gbp_admin_library: 0.4.669
  • gbp_permanent_links: 0.14.4

Offline

#482 2009-09-01 20:45:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,408
Website GitHub

Re: gbp_permanent_links

For anyone who’s experiencing the “Strict Standards: Only variables should be passed by reference” thing with gbp_permanent_links, the fix is fairly trivial, if non-intuitive at first glance. Scroll down to line 515ish (as of v0.14.4) in the plugin and replace this:

if (!@$pretext_replacement && count($this->partial_matches))
	$pretext_replacement = array_shift(array_slice($this->partial_matches, -1));

with this:

if (!@$pretext_replacement && count($this->partial_matches)) {
	$pt_slice = array_slice($this->partial_matches, -1);
	$pretext_replacement = array_shift($pt_slice);
}

That should make everything happy again.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#483 2009-09-02 05:10:09

LetterHoofd
Member
From: Kortrijk, BE
Registered: 2006-01-20
Posts: 40
Website

Re: gbp_permanent_links

@Bloke
That did the trick. Thanks!

Offline

#484 2009-09-02 08:41:53

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

Re: gbp_permanent_links

@Bloke
Thanks! I’ll role out a new version later today.

Offline

#485 2009-09-13 17:49:06

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: gbp_permanent_links

I’m trying to allow a permanent link that ignores the article title if specified on a /section/id/ link. I thought this would be accomplished by building a permanent link rule like this:

section /id /.* /

However, that doesn’t seem to be working, I’m getting a 404 for URLs iwth the correct section, correct id, but wrong title.

Is it possible to create a permanent link that ignores the trailing title?

Last edited by mericson (2009-09-13 17:51:32)

Offline

#486 2009-09-13 18:25:36

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

Re: gbp_permanent_links

Are you planning to use this rule site wide? Only asking because Txp can do this without the plugin :)

Offline

#487 2009-09-13 18:27:43

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Re: gbp_permanent_links

Yes, I was planning to do this sitewide and I was used to the fact that Txp does the title stripping for me. However, after using gbp_permanent_links (for other URL formats I must support) that behavior (stripping article title) doesn’t seem to be working.

Els wrote:

Are you planning to use this rule site wide? Only asking because Txp can do this without the plugin :)

Offline

#488 2009-09-13 18:54:52

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

Re: gbp_permanent_links

mericson wrote:

However, after using gbp_permanent_links (for other URL formats I must support) that behavior (stripping article title) doesn’t seem to be working.

Ah, I see. I was going to give this rule a try on my test install, but I’m having trouble getting the plugin to work at all in 4.2.0… But doesn’t it work if you just use a rule like /section/id/?

Offline

#489 2009-10-13 03:43:47

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: gbp_permanent_links

OK, I thought I had a grasp on this plugin and conditionals, but I need some help. Using v.14, set up a section/category/title that works very well. However, I am having issues getting the correct conditionals in the page template to work correctly. I need all of the following URL schemes to work:

  • site.com/section
  • site.com/section/category
  • site.com/section/category/title
  • site.com/section/title (for articles not in the above category)

Using different types of conditionals, this is as close as I can get:

<txp:if_category>
	<txp:article />
<txp:else />
	<txp:if_individual_article>
		<txp:article />
	<txp:else />
		<txp:article_custom id="3" />
	</txp:if_individual_article>
</txp:if_category>

This code gets everything but site.com/section (the hard-coded article_custom tag) to display properly. I am sure someone has run into this before, so any help would be very appreciated. I searched through some older posts but didn’t see anything useful.

Update: This code actually works. The problem was not in the conditional structure, but the fact that the article with the ID of 3 had a URL title competing with the section name, so TXP didn’t know if it was site.com/section or site.com/article-title and went with the latter. Changing the URL title of the article to something unique solved the problem. Hopefully this helps someone else down the road.

Last edited by kevinpotts (2009-10-14 02:00:20)


Kevin
(graphicpush)

Offline

#490 2009-10-14 14:04:14

si.b
New Member
Registered: 2009-10-14
Posts: 5

Re: gbp_permanent_links

I know this is a very basic request, but as a non-IT person who has been using textpattern for a couple of years and can usually get plugins to work after a bit of trial and error, somehow this one’s stumped me.

Firstly, I kept getting error messages with everything but the minified version, so hopefully this is an ok one for me to be using.

Then, I’m basically just trying to change a messy URL structure to a clean and rewrite the old URLs – probably just section/title, as I don’t use categories on the site. Does anyone have a couple of minutes to write a very brief few steps I should be following, as at the moment I get 404s rather than redirects across the site. I guess it has something to do with the ‘Redirect this permanent link to…’ section from looking at other posts in this thread, but I have no options in the dropdown and have no idea what I should be putting in ‘HTTP location:’

Thanks!

Offline

#491 2009-10-14 16:03:15

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: gbp_permanent_links

There is an option to change messy url to section/title directly in the preferences, you don’t need a plugin.

Offline

#492 2009-10-15 12:13:29

si.b
New Member
Registered: 2009-10-14
Posts: 5

Re: gbp_permanent_links

Thanks Zanza, but when I do that, none of the old links on the site work. And there are a lot…

Offline

Board footer

Powered by FluxBB