Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#373 2008-05-27 14:19:41

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: gbp_permanent_links

Bloke wrote:

OK, in that case, let me think about it and see what I can come up with.

cool! good luck mate!

Offline

#374 2008-05-27 14:26:26

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

Re: gbp_permanent_links

Hi Graeme,

exciting news!!!

An often requested “feature” for this plugin is documentation.

Also, I’ve reported an issue that may be useful if you are on a bug hunting.
What I still find “un-intuitive” is when (and why) to use gbp_disable_permlinks. Right now, I find myself having to manually check links on pages to see if they have been (or not) affected by gbp_permanent_links.

Feature request::

To have the option to choose which category (1 or 2) to use when creating permanent links using /category-name/.
This will make the following as possible URLs:
/section/category1/article-title,
/section/category2/article-title,
/section/category1/category2/article-title,
/section/category1-category2/article-title

I’m not totally sure about the last two examples, and them could work flawlessly with TXP.
Currently, a permanent link (done with your plug-in) like this:
/section/category/article-title
will work as a category listing if you go remove the article-title, that is, if you go to this url: /section/category/.

So, the last two examples I posted as possible URLs may not work if visitor points to /section/category1-category2/ or /section/category1/category2/.
Also, related to those two possible URLs, there is this problem: what if category2 (or category1) aren’t defined?. It will be nice that, in that case, the separator (-, /) should be removed, to avoid it on the final URL (/section/category1//article-title or /section/category1-/article-title).

Last edited by maniqui (2008-05-27 14:27:15)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#375 2008-05-27 15:27:14

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

Re: gbp_permanent_links

Bloke wrote:

Techie question to graeme then: if I was to “grab” the current URL in order to parse it, where’s the best place to get it? e.g. can I use parts of the $_SERVER variable to obtain your faked URL schema?

You could use the $_SERVER variable but permanent_links uses:

$segments = explode('/', trim(preg_replace('%\?[^\/]+$%', '', $pretext['req']), '/'));

this is good because I don’t have to worry about TxP installs in subdirectories.

Offline

#376 2008-05-27 15:28:16

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

Re: gbp_permanent_links

redbot wrote:

Hi Graeme, I seem to remember that previously on this thread there were some requests for a section1/section2/article url structure (fake subsections). Is this a viable request?

Yes – this will be possible :)

Offline

#377 2008-05-27 15:36:22

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: gbp_permanent_links

Graeme>

Image and other content type categories in the url. eg

http://tld.com/section/image-link-or-file-category

Offline

#378 2008-05-27 15:46:41

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

Re: gbp_permanent_links

mrdale wrote:

Image and other content type categories in the url

Yes – this is the whole reason of the new version.

Am making it flexible so other plugins can make changes the fields in a content type or add their own content type. E.g. zem_event could add ‘event’ content type so a user could make a rule like /event/location/date

Cool… can you see why I’m getting excited about this?

Offline

#379 2008-05-27 15:50:25

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

Re: gbp_permanent_links

jelle wrote:

Don’t know how much work is involved but I’d like to be able to read each part of the permanent link though an IF statement (regardsless of where it acutally comes from (category/section/etc)

The plugin already provides gbp_if_regex and gbp_if_text and with if_section, if_category etc… so you should already be able to do a IF statement on any part of the URL. Which has the advantage of working for all permalink rules and doesn’t rely on the position of that part of the URL. (Does that make any sense?)

But I do kinda like you idea and I think it would be useful for some people. I think Block’s idea of extending smd_if might be the better thing to do.

Offline

#380 2008-05-27 15:51:25

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: gbp_permanent_links

graeme wrote:

Yes – this will be possible :)

Wow! It’s the beginning of a new era, thanks!
BTW can I expect fake subsections to work with the MLP?

Last edited by redbot (2008-05-27 15:55:41)

Offline

#381 2008-05-27 16:14:43

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

Re: gbp_permanent_links

maniqui wrote:

An often requested “feature” for this plugin is documentation.

Hopefully it won’t need documentation ;) But there will be some, I’m trying to make it much clearer what the different options and preferences do.

What I still find “un-intuitive” is when (and why) to use gbp_disable_permlinks. Right now, I find myself having to manually check links on pages to see if they have been (or not) affected by gbp_permanent_links.

gbp_disable_permlinks might be deprecated – not quite sure if it will still be needed. As it is I agree it’s un-intuitive – it should really be named something like gbp_use_default_permlink_rule

To have the option to choose which category (1 or 2) to use when creating permanent links using /category-name/.
This will make the following as possible URLs:
/section/category1/article-title,
/section/category2/article-title,
/section/category1/category2/article-title,
/section/category1-category2/article-title

I’m not totally sure about the last two examples, and them could work flawlessly with TXP.

Option to choose which category 1 or 2 will be there. Custom separators (as in example 4) – Yes I’m in the process of implementing that.

So, the last two examples I posted as possible URLs may not work if visitor points to /section/category1-category2/ or /section/category1/category2/.

URLs like that will need to work – and show a category listing of articles in category1 AND category2. I’ll make sure I test for this.

if category2 (or category1) aren’t defined?. It will be nice that, in that case, the separator (-, /) should be removed.

Separators (custom or not) will be applied to individual segments. Rule segments will be given an ‘optional’ option so when generating a URL they will be left out if the article (or other content type) doesn’t have that field. So the problem shouldn’t exists. :)

Offline

#382 2008-05-27 16:22:10

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: gbp_permanent_links

oh my… this is going to be the most awesome plugin in the history of textpattern, EVER. :)

(sorry glz_custom_fields ;))

Offline

#383 2008-05-27 16:24:31

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

Re: gbp_permanent_links

redbot wrote:

Wow! It’s the beginning of a new era, thanks!
BTW can I expect fake subsections to work with the MLP?

Support for subsections won’t be native to gbp_permanent_links. I will need to be implement through as a separate plugin. In my reply to mrdale I said:

Am making it flexible so other plugins can make changes the fields in a content type or add their own content type

Subsections is one of the reasons for making the plugin flexible.

I will be looking at subsection plugins (if there are any – I don’t use them currently) and seeing how easy to hook into permanent_links – or I shall write a very quick example plugin which should give someone a good starting point.

But yes in theory it’ll work with MLP too.

Last edited by graeme (2008-05-27 16:25:59)

Offline

#384 2008-05-27 16:26:51

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

Re: gbp_permanent_links

sthmtc wrote:

oh my… this is going to be the most awesome plugin in the history of textpattern, EVER. :)

Hopefully

Offline

Board footer

Powered by FluxBB