Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#349 2008-03-27 21:39:43
Re: gbp_permanent_links
A lot of my code just looks at the url to figure out what to display. i.e. It doesn’t rely on $pretext[‘s’] that the rule sets after a match.
Would it be possible to offload some of the strange rules into .htaccess? I was thinking of experimenting this afternoon.
Thanks again!
Offline
#350 2008-04-02 16:38:14
Re: gbp_permanent_links
hi Graeme!
I finally have a chance to use your plugin and it’s brilliant!! I came across a couple of things I hope you can help me with:
My url structure looks like section/category/search
except I am having a hard time getting a hold of the search
part. I tried adding ‘q’ to line 589:
foreach (array('id', 's', 'c', 'pg', 'is_article_list', 'prev_id', 'prev_title', 'next_id', 'next_title') as $key) {
And that works in so far as txp:search_
tags will work, however the ‘q’ value gets added twice and I have no idea why?! For example, if the url is products/wines/reds
and I add ‘q’ to the above array, the txp:search_term
tag will output: ‘reds reds’.
Otherwise I am only able to access ‘q’ from the global $pretext[‘q’] – however the txp:search_
tags do not work.
Also, I came across a very small typo in the plugin, line 1438 should be:
has_page_or_search = true;
Thanks again Graeme!!
Travel Atlas * Org | Start Somewhere
Offline
#351 2008-04-02 20:26:14
Re: gbp_permanent_links
Hi Graeme,
Fantastic plugin, truly great work.
The only issue I am having with it is that it makes my <txp:link_to_next>
<txp:link_to_prev>
links incorrect. Instead of, like the rest of my site using /category/title/
via your plugin they are stuck using the default TXP Permalink mode.
Is their a solution to this? Custom Prev/Next tags?
Thanks!
Sam Brown
sambrown.me | welovetxp.com
Offline
#352 2008-04-03 11:26:00
Re: gbp_permanent_links
I’m having a small problem. It seems like my navigation created with section_list adds the category to the url for the links.
So if I have visited “SectionA” and the category “Category 1” (/sectionA/category1) and click the “SectionB” link i expect to end up at /sectionB. But instead i end up at /sectionB/category1.
So the question is how do i remove the categories from the url:s generated by the section_list?
Offline
#353 2008-04-03 14:37:06
Re: gbp_permanent_links
hi Graeme,
I’m having a hard time understanding some of the logic in PL. For example, I have a section/category
rule with no conditions that forwards to one page. I have another section/category
rule with conditions that it should only apply within category ‘tal’ that forwards to another page – this rule has higher precedence than the previous.
From what I can tell, the plugin looks at the url comparing it against the rule with the higher precedence:
- Yes, we are in a section
- Yes, we are in a category
- Both conditions have been met, break from the comparison table
- Oops, the category doesn’t meet the condition ‘tal’ – match failed, render default page for the section
What I am doing wrong? It seems to me the plugin should work like this:
- Yes, we are in a section
- Yes, we are in a category, oops it is not category ‘tal’ – continue to the next rule
Then
- Yes, we are in a section
- Yes, we are in a category (in this case there are no conditions)
- Both conditions have been met, break from the comparison table
- Forward, redirect, etc..
Please help me understand this. Thanks Graeme!!
Last edited by rloaderro (2008-04-03 14:38:10)
Travel Atlas * Org | Start Somewhere
Offline
#354 2008-04-06 23:17:33
- johnnie
- Member
- Registered: 2007-03-10
- Posts: 58
Re: gbp_permanent_links
Thanks for this awesome plugin. I want to use it to cloak some affiliate URLs. The problem is, I can’t find a way to insert the regexp-part into the target HTTP-location? How do I do this? For example, I want http://www.site.com/redirect/24/58 to redirect to http://www.affnetwork.com?affid=24?mechid=58
I know I can use mod_rewrite for this, but this seems like a more elegant solution :)
Last edited by johnnie (2008-04-07 00:27:02)
Offline
#355 2008-04-09 19:36:42
- snthr
- Member
- Registered: 2007-07-13
- Posts: 42
Re: gbp_permanent_links
hi…
i was directed to this thread from one i’d started here, where i was explaining my difficulty in understanding this plugin, and in understanding how to get a three-level nav going in textpattern.
in case i’ve missed it, is there any documentation for this plugin, anywhere? or is there anywhere that explains, in lay-person’s terms, how to get it to work?
i don’t want to sound snarky, but it’s frustrating to spend two days in textpattern trying to get something to work that takes two minutes to set up in wordpress. i’m a css person, not a full-time textpatterner, so i need my plugins to be idiot-proof. :)
everybody here seems to be saying that this is a great plugin, and i’d love to be able to say the same, but i have to get it working first. any links or explanations handy?
thanks…
Offline
#356 2008-04-09 21:51:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: gbp_permanent_links
snthr
When you have installed the plugin, you will find a tab ‘permanent links’ under the ‘admin’ tab. Choose the ‘build’ tab. The default permanent link rule is what you need: section/category/title. Give it a name, and if you only want it for section ‘members’ enter that under ‘conditions’. Save it.
That should give you URLs like site.com/members/john-doe/something-about-john/ to the article titled ‘Something about John’ that is in section ‘Members’ and category ‘John Doe’.
Edit: I gave an example for the code on your page in the other thread.
Last edited by els (2008-04-09 22:19:12)
Offline
#357 2008-04-19 01:13:59
- ookpik
- Member
- Registered: 2005-05-05
- Posts: 18
Re: gbp_permanent_links
This plugin is useful and lovely and I use it a lot. Thanks!
One issue I’m having though… I find that pagination breaks in the default section when this plugin is enabled, whether or not there are any rules set up. Every page link, messy or clean (domain.com/?pg=2, etc) comes up 404 until I turn off the plugin, at which point they work as expected. Anything with a non-default section in the url seems to work fine (domain.com/articles/?pg=2 or any variation). This is Txp 4.0.6.
Anybody have ideas?
Thanks.
(Apologies if this has been covered… I did work through the 36 pages in this thread but my eyes may have glazed over a couple of times.)
Offline
#358 2008-04-27 04:12:11
Re: gbp_permanent_links
Hi!
I’m on a TxP 4.0.6 installation, almost clean, and with latest gbp_admin_library (0.4.669) and gbp_permanent_liks (0.11.669).
No custom permanent link rules created yet.
I was having some minor issues.
So I disabled every plug-in, and finally find out that the issues were being caused when gbp_permanent_links was active.
Basically, when the plug-in is active, there are some URLs (generated by TxP built-in tags) that look like if TxP has been set in messy mode.
For example:
<txp:category1 link="1" title="1" section="articulos" this_section="1" />
outputs this:
http://domain.com/index.php?s=articulos&c=recursos-humanos
instead of this:
http://domain.com/articulos/?c=recursos-humanos
If I disable the plug-in or wrap the TxP tag with <txp:gbp_disable_permlinks>
, I get the correct (clean URL) output (the second one above).
This is not the first time I found myself wrapping some blocks of TxP code with the gbp_disable_permlinks
tags, so this isn’t something new for me.
But still, i couldn’t find out yet a common “pattern” to understand this issue.
Why does it affect the output of some tags and not of other? (for example, <txp:permlink><txp:title /></txp:permlink>
isn’t affected).
My “theory” (just a feeling) is that it affects those tags that has some “messy” output (like URLs with variables), and probably related with this comment on the plug-in code: // Force Textpattern and tags to use messy URLs - these are easier to find in regex
.
But now I’m talking about obscure magic I don’t understand at all so I better stop conjecturing.
So, summarizing:
Failing scenario
- plug-in active
- code:
<txp:category1 link="1" title="1" section="articulos" />
- output:
http://domain.com/index.php?s=articulos&c=recursos-humanos
Working scenarios
- plug-in active
- code:
<txp:gbp_disable_permlinks><txp:category1 link="1" title="1" section="articulos" /></txp:gbp_disable_permlinks>
- output:
http://domain.com/articulos/?c=recursos-humanos
Or
- plug-in disabled
- code:
<txp:category1 link="1" title="1" section="articulos" />
- output:
http://domain.com/articulos/?c=recursos-humanos
Some side notes
I’ve also installed zem_redirect 1.2, but after having this issues (similar to this one with gbp_permanent_links I’m reporting) I disabled it.
So during the above testings, zem_redirect was disabled.
I just mention this for two reasons:
- not sure if any or if both plugins introduce changes on TxP to the databases, but if they did, even when they are disabled, they have already done something that could be affecting each other (gbp plug-in affecting zem plug-in and/or viceversa) or Txp itself.
- the issue with zem_redirect seems to be similar to this one, so maybe there is some “common pattern” between them, or maybe this is related to some change on TxP 4.0.6
I hope Grame could find some time soon to play with his plug-ins.
Sorry for this large post and for my english.
Thanks in advance.
Offline
#359 2008-05-11 22:18:37
- Crossbound
- New Member
- From: Florida, USA
- Registered: 2008-05-11
- Posts: 5
Re: gbp_permanent_links
I’m having the same problem as JB.. I’m using a clean install of TXP 4.0.6. After navigating to the default article (First Post), section links become /section/categoryOfCurrentArticle instead of simple /section
Offline
#360 2008-05-19 21:23:36
Re: gbp_permanent_links
Maybe what we need is a repository of examples as they are developed, for those of us (notably me) who can’t seem to get his head around how the plugin works.
I’m trying to put together a site with section=“representation”, category=“theatrical, voiceover” and articles. I’ve set Permanent Link Rule section/category/title with section=“representation”. Conditions is section=“representation”. No other settings.
This produces a list of articles with URL (for example) foo.com/representation/theatrical/american_agency. When I click on the link, I get the error, “The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”
If I edit the URL to read foo.com/representation/american_agency, it resolves to the correct page. So, what am I doing wrong?
Offline