Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#505 2009-10-31 21:55:58
Re: gbp_permanent_links
This might not be relevant, but of late (perhaps it’s a 4.2.0 thing) I’ve found it necessary to set the default Txp url prefs to messy, then override them all with gbp_pl. For reasons I haven’t figured, a combination of clean Txp url prefs and gbp_pl seems to produce unwanted results.
Offline
#506 2009-10-31 22:16:40
Re: gbp_permanent_links
Hi Maese Pieman,
thanks for chiming in and share your knowledge.
I see that on 6of3 (running on 4.2.0), preference is set to /section/title
, but as we have created a lot of rules maybe we have covered every situation where a messy URL could appear…
As I’m using MLP, it seems that setting url prefs to messy is not an option. I’ve found that I can “fix” some of this messy URLs by just wrapping the output in <txp:gbp_disable_permlinks></txp:gbp_disable_permlinks>
.
Another solution that I can apply on many places is to recreate clean URLs using chunks of information that can be rendered by TXP tags.
For example, instead of:
Browse article on <txp:section>this section</txp:section>
(which would output a messy link)
I can do:
Browse articles on <a href="/<txp:section>">this section</a>
(which is clean)
Of course, it’s a lot more of work, and having MLP in the middle doesn’t really help :)
Offline
#507 2009-11-02 01:34:06
Re: gbp_permanent_links
Another thing to report:
I’m developing a site tha runs on “Testing” mode. Thankfully, I’m not getting any kind of notices nor errors messages.
Until I create the first gbp_p_l rule.
Then, my install begins to show this kind of error messages on the front end
Tag error: <txp:title /> -> Textpattern Notice: Article tags cannot be used outside an article context on line 2175
Tag error: <txp:if_custom_field name="files"> -> Textpattern Notice: Article tags cannot be used outside an article context on line 2175
(this is just an example of the).
Not sure what’s going on, but again, after creating a gbp_p_l rule, those errors are “un-silenced” and begin showing on the front-end.
Any ideas of what could be going on?
Offline
#508 2009-11-02 03:34:26
Re: gbp_permanent_links
Maese pieman, maese graeme et all,
after fighting a little with gbp_p_l, once of those unexplainable miracles happened. Things just started to work. This is not the first time that it happened, now I remember than on previous TXP + gbp_p_l installs, it already happened to me.
It’s like there is after doing something (not sure yet what), gbp_p_l begins to behave.
Remember my two issues reported above?
- messy URLs being output on built-in tags (like section_list, section, file_download, etc)
- error messages appearing “un-muted” after creating a permanent link rule
Well, both magically disappeared.
What did I do to fix it? Not sure. I think it was switching from a clean URLs scheme to messy URLs (on Admin -> Preferences) and then switching back to a clean URLs scheme. I think that was the thing that triggered the miracle, as now I remember that on other ocassion, that fixed it too.
It’s like gbp_p_l has to “compile” something before starting to work properly.
Hope this helps anyone else.
Offline
#509 2009-11-02 03:46:34
Re: gbp_permanent_links
BTW, one minor thing regarding file downloads URLs.
I’m not sure since when (since which TXP version, I think it was 4.2.0) file download URLs have the filename appended to them.
Like this: /file_download/123/my_file.ext
.
A nifty addition that may not only improve usability but also maybe it earns some extra SEO points.
Now, I’ve noticed that gbp_p_l “reverts” those URLs to the old ones. In other words, txp:file_download_link
in tandem with gbp_p_l will return the “old version”, for example: /file_download/123
.
Not that bad, as the URL is fully functional (the file can be downloaded without a glitch).
@graeme, do you think there is a chance to “fix” this?
In the meanwhile, I’ll keep crafting my file URLs from each chunk of information (file_download_id, file_download_name, etc) provided by TXP.
Thanks.
Offline
#510 2009-11-02 16:19:20
Re: gbp_permanent_links
maniqui wrote:
In the meanwhile, I’ll keep crafting my file URLs from each chunk of information (file_download_id, file_download_name, etc) provided by TXP.
Maniqui, it might reassure you to know that I’ve just experienced similar problems as you reported yesterday
Used in the News section, this returns the gbp_pl defined (section/yyyy/mm/dd/title) url:
<txp:article_custom section="news"><a href="<txp:permlink />" rel="bookmark"><txp:title /></a></txp:article_custom>
But used in any other section, exactly the same code returns a /section/title url instead – even though I have prefs=messy (!)
Had to build it manually with /news/<txp:posted format="%Y" />/<txp:posted format="%m" />/<txp:posted format="%e" />/<txp:article_url_title />
Don’t have time to do any further diagnosis at the mo, will try and get to the bottom of it soon.
Offline
#511 2009-11-02 16:26:04
Re: gbp_permanent_links
Weird. I’ve had some gbp_p_l “insights” today at morning, while I was chit-chatting (no technical questions involved) with graeme at #xpat channel.
As I mentioned before, things get fixed for me by doing any or all of this things:
- Switched to messy URL mode and then back to
/section/title
mode - momentarily reverted to 0.14.4 and then back to 0.14.5
- created a few rules, deleted them, created them again, and so on…
Not sure what, but something made TXP and/or gbp_p_l “click”.
Regarding your issue, have you checked the “precedence” value? If no precedence value, then tags like txp:permlink
aren’t affected. You taught me that one, cowboy!
Offline
#512 2009-11-02 16:33:16
Re: gbp_permanent_links
I tried doing the messy/clean flip as suggested, but no luck so far. Will try reverting to older version and see if it works for me.
Normally if txp:permlink doesn’t output the gbp_pl url then it is indeed a matter of clucking around with the precedence. But I’ve never found a situation where it works in one place and not another – normally it either works universally for that kind of link or it doesn’t. This is a new one for me.
Offline
#513 2009-11-02 17:38:20
Re: gbp_permanent_links
pieman wrote:
Normally if txp:permlink doesn’t output the gbp_pl url then it is indeed a matter of clucking around with the precedence.
Is that behaviour desirable or confusing? Sounds like a bug because as far as I’m aware txp:permlink
should be outputting a gbp_pl url regardless of the precedence.
Also maniqui: I’ll have a fix for the file downloads urls out later.
Offline
#514 2009-11-02 17:43:35
Re: gbp_permanent_links
graeme wrote:
Is that behaviour desirable or confusing?
Confusing. With the necessary precedence assigned txp:permlink normally outputs the gbp_pl URLs using all native tags in all situations. This is the first time I’ve seen it vary according to which page template it’s used in. Definitely a bug – but I’ve used this plugin loads before and not come across it so it’s quite strange. Not a big problem in this case though – it’s a small site and easy enough to work around.
Offline
#515 2009-11-02 18:17:17
Re: gbp_permanent_links
New release which fixes two problems:
- Problem with rule conditions not being used – see this post
- File download URLs are now formatted correctly
Offline
#516 2009-11-02 18:19:04
Re: gbp_permanent_links
pieman wrote:
Confusing. With the necessary precedence assigned txp:permlink normally outputs the gbp_pl URLs using all native tags in all situations. This is the first time I’ve seen it vary according to which page template it’s used in. Definitely a bug – but I’ve used this plugin loads before and not come across it so it’s quite strange. Not a big problem in this case though – it’s a small site and easy enough to work around.
I will add this to the list of things to look at. I had thought I would do away with precedence values in the next version but I’m not sure that’ll be possible any more.
Offline