Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#253 2007-10-26 16:36:00

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: gbp_permanent_links

Hmmm.. I was afraid of that.

I have a new major site that has a main page with news for the entire organization.

This organization has 4 divisions (say A, B, C and D)

When you go to these divisions, you just see news for that division. Nothing special yet.

But, each of these divisions is has an ‘About’, ‘Funding’, ‘Annual Report’ section.

Inside the Annual Report section for example, you need to organize it by year. Then by year, you need to subdivide by team (one of the divisions has more than 10 teams inside). Then you need to have the project name itself which can be the article title.

So you’ll have A/Report/2007/ABC/Project1/Title

The problem is “Report” in this case is very different between the divisons, so I didn’t want to make it variations of the same page template (but I could if necessary)

However, once inside the right page, Year, Team, Project, Title are just parameters. Is there a way to do convert the example URL to A/Report/?year=2007&team=ABC&project=Project1&Title=title or something?

I hope I explained my situation clearly.

Thanks,
Shige

guiguibonbon wrote:

Yup, it will slow it down quite a bit. Could you tell us a bit more about what you are to achieve? What’s different in each section?

Offline

#254 2007-10-26 16:47:37

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: gbp_permanent_links

Is a more elegant solution to setup a regex like sthmtc did?

/(^division_1$|^division_2$)//funding//[0-9]{4}//[a-z]{2,11})//

with the names for the parts as follows:

/division/funding/year/team

Then just break down the URL parts inside the target page like:

$division = $pretext[“permlink_regex_division”]; /* for the permlink rule regex I called “division” */
$year = $pretext[“permlink_regex_year”];
etc.

So if I use this method, I’ll reduce the number of rules by a lot, but I may still end up with like up to 10 regex permlinks rules like this. Will this be ok in terms of performance?

guiguibonbon wrote:

Yup, it will slow it down quite a bit. Could you tell us a bit more about what you are to achieve? What’s different in each section?

Offline

#255 2007-11-01 16:41:46

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: gbp_permanent_links

I don’t know when and why (I suppose it was when I updated to the new gbp_admin_library 0.4.581 or maybe when I updated to TxP 4.0.5) but there is something that isn’t worked as it used to work and as I expect it to work.

I’m using this plug-in for the most simple and common task for this plug-in: simulate a “subsection” by creating an URL made by section/category/title.
In fact, I’m not even doing it for achieve a “subsection” but my main goal is some SEO optimization, by having the category as a possible keyword.
BTW: I’m doing this for just one section on my site.

Well, so, after that intro, here is my problem (that I didn’t have before, a few months ago):

- I expect that any hit to an /section/title URL will be redirected to /section/category/title.
That is how it used to work.

But today, I have found that both URLs are working.
So, I’m afraid to be penalized for duplicated content. In fact, both URLs are listed in Google search results page.

Now, I remember (and must admit), that I have recreated the rules few months ago (after the upgrade). But I’m looking at them and every rule seems to make sense.

So, the question is: how do you achieve this basic task? (I’m sure I’m not the only one doing this trick with this plug-in).

Any help and suggestion will be appreciated.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#256 2007-11-01 19:56:01

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: gbp_permanent_links

Mmmm…

I think it’s fixed. It seems that I forgot to configure the “Redirect this permanent link to…” in the /section/title rule. I configured it to redirect to the /section/category/title rule.

I did it before my previous post, but it seems that it “didn’t work” because of some server or browser cache.

Now I tried again and it worked as expected.

PD: It would be good to have an expert write some basic documentation for this plug-in, including some examples, je. :D

Last edited by maniqui (2007-11-01 19:58:17)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#257 2007-11-05 14:42:36

Shaliza
Member
Registered: 2006-01-22
Posts: 59

Re: gbp_permanent_links

I agree that an example should be included. I already posted this in another post, but here’s what I’m trying to do:

Let’s say I write an article & the main section for it is News, but it falls under another section called Entertainment. The link should look something like:

domain.com/news/entertainment/article

How exactly would I go about setting this up?

Offline

#258 2007-11-05 15:00:13

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: gbp_permanent_links

“Entertainment” will be more a category than a section. So, you can create an “Entertainement” category, assign the article to that category and then setup a permalink rule like this (in the Permalink tab):

Create a new rule:

1. Permalink rule: section/category/title
2. In Settings: a name (like “section-category-title” or whatever) and precedence = 100
3. In Conditions: Within section “News”

Now, create another rule:

1. Permalink rule: section/title
2. In Settings: a name (like “section-title” or whatever) and precedence = 90
3. In Conditions: Within section “News”
4. In Redirections: Redirect this permanent link to: section-category-title.

That’s all. (I think)

I would like to see other examples, :D


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#259 2007-11-06 23:50:39

Shaliza
Member
Registered: 2006-01-22
Posts: 59

Re: gbp_permanent_links

That seems to do the trick – thanks!

If I have any problems, I’ll come back.

Offline

#260 2007-11-19 03:25:50

shingoxray
New Member
Registered: 2007-11-12
Posts: 1

Re: gbp_permanent_links

I hope there would be a document describing every detail of the options.
That will be very nice.

Offline

#261 2007-12-08 18:05:04

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: gbp_permanent_links

This is an essential plugin to my project and has worked magnificently except for one case.

Most of my rules are based on text matching, i.e. match “abc/about//.*//” etc.

This has worked as expected except with txp:older and txp:newer tags.

With the plugin off, it wants to go to http site/?pg=x

With the plugin on, it goes to the first text matching rule alphabetically. So it wants to go to http site/abc/about/x

I have a rule that matches section and title, and it never tries to go there.

Actually, I’m not sure if text matching rules is what’s setting it off because all the text matching rules also match wildcards too. Is /.*/ the correct way to match anything?

If this is supposed to happen, what should I do to make the older / newer tags work properly again?

Thanks!

Offline

#262 2007-12-08 18:10:58

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: gbp_permanent_links

I must admit that I didn’t understand too much about your settings (I would like to know what’s that about text matching)

Have you tried wrapping your older/newer tags with the “gbp disable permanent link” tag? (look at the plug-in code to see what’s exactly the way to write the tag, because I can’t remember right now)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#263 2007-12-09 04:09:45

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: gbp_permanent_links

maniqui: Thank you very much for the suggestion. I tried the following:

<txp:gbp_disable_permlinks><txp:older><txp:text item=“older” /></txp:older></txp:gbp_disable_permlinks>

It didn’t make any difference to the output.

My new project needs to emulate section/sub-section/sub-sub-sections/etc and so I have a variety of permlink rules to make that happen using text matching (as opposed to regular-expressions, or sections)

Basically, going to /abc/def/ is the same as going to a section called “abc-def”

It has worked perfectly so far except for the problem with the tag for older/newer articles.

I was scanning the forums and there was some issues with this plugin and the postmaster plugin. Any chance there is something related..?

Thanks

Edit: Solved. I added some new rules. I overlooked the fact that the plugin can match page numbers.

Last edited by typeshige (2007-12-10 19:07:35)

Offline

#264 2007-12-17 01:46:48

Shaliza
Member
Registered: 2006-01-22
Posts: 59

Re: gbp_permanent_links

Not sure what happened, but it no longer works for me. Now I get a 404 page. I only have three other plugins installed:

gbp_admin_library [active obviously]
chh_title [active]
rss_suparchive [not active]

I tried making chh_title inactive, but that didn’t do the trick. Anyone know what the problem might be?

Last edited by Shaliza (2007-12-17 02:04:44)

Offline

Board footer

Powered by FluxBB