Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-27 01:12:32

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

[plugin] [ORPHAN] etz_pseudo

This plugin introduces a new method to integrate the various Textpattern resources (articles, pages, files, images) in the level of Textile source, without changing Textile itself. It’s sort-of a counter-suggestion to this, but can be extended to a whole new level of functionality.

Right now, it replaces txp:// pseudo-URIs with their http:// equivalents.

Usage:

Surround <txp:body /> or anything that contains txp:// pseudo-URIs with <txp:etz_pseudo> and </txp:etz_pseudo>.

Supported pseudo-URI schemes:

  • txp://pseudohost/article/ID
  • txp://pseudohost/image/name
  • txp://pseudohost/image_id/ID
  • txp://pseudohost/file/name
  • txp://pseudohost/file_id/ID
  • txp://pseudohost/category/name
  • txp://pseudohost/section/name
  • txp://pseudohost/author/First%20Last

For now, the only pseudo-host supported is this, meaning the current Textpattern installation. In the future, this may enable “interwiki”-style links between Textpattern sites, or even more integrated sharing of their resources.

Note that this is still in an experimental phase, and the supported URI schemes’ syntax may change a little bit in the future. At this early stage, suggestions to change the pseudo-URI syntax can be welcome.

Download version 0.1 now!

This software is both free as in beer and free as in freedom. If you like it or think it’s useful, you may consider bying me something from my wishlist.

Last edited by Etz Haim (2005-11-24 20:15:52)

Offline

#2 2005-10-27 20:09:50

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [plugin] [ORPHAN] etz_pseudo

As “I’ve said”, I believe this would be more helpful as a patch to the core TXP.

But let’s talk about the scheme. The main need, is – I think – to anyone (including the most non-geek grandma) to make easy links. And the most things linked, would be an article.

So, for me,:

  • pseudohost is a good idea, but this should be by default. Aka this would not be necessary.
  • /article/ should also be optionnal. It is not locale-dependant, still a little technical, and longer to type.
  • txp is also longer, and a little bit technical/geek. It would be nice to have it optionnal too.

So, it means that – for me – the link to an article would be then //ID and/or //article-title.

On the rest of the schemes, it would be nice (if possible, I don’t remember the SQL scheme) to be able to call a category or section by ID. Categories especially, since they very may change name in the lifetime of a website. Same for the authors.

On the locale things, it’s a global issue. To really be usable by anyone, the english should always be callable, but also the i18n version of it. For example in french (using your scheme proposal): txp://pseudohost/file/name should work, but also txp://pseudohôte/fichier/nom.

Offline

#3 2005-10-27 20:58:02

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [plugin] [ORPHAN] etz_pseudo

I agree that pseudohost should be assumed to be this unless present.

I also think txp: would ideally be unecessary if there is a way to get along without it.

Ideally I would like to see the syntax not resemble a regular URI as much just to make it clear to the user that you cannot browse to the specified URI. I’m sure someone will think exactly the opposite in that traditional URI styles might be less jarring to the user.

I would prefer it something more akin to maybe something like Smarty <code>"my link":element-type|element-id</code> or markdown <code>"my link":element-type[element-id]</code> maybe the element-type could be assumed to be article if missing.

Some actuall examples:

  • Smarty style: <code>"my link":file|file-id, "my link":article|article-id</code>
  • Markdown style: <code>"my link":file[file-id], "my link":article[article-id]</code>

I personally prefer the markdown style but that could just be the programer in me, but neither actually looks like a valid URI which to me would be ideal square brackets also get a plus from me because they don’t require the shift key (neither does using forward slahes though).


Shoving is the answer – pusher robot

Offline

#4 2005-10-27 21:34:38

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] etz_pseudo

@jeremie: This is an attempt to define a standard, possibly like XPointer, for all the TXP sites using it regardless of their locale. What would happen if a “french-speaking” host linked to a greek- or english-speaking host via a txp:// pseudo-URI? The reason that I’m asking is because I actually have plans to introduce such a feature.

Also, as I’ve said elsewhere, my idea is to help this mature as a plugin first, and then port its desirable features to the core Textpattern distribution through a patch submission.

@hakjoon: The txp:// pseudo-URIs are “semantic” entities and carry a certain meaning on their own, regardless if they are used inside XHTML, Textile, Markdown, or anything else. What you are suggesting is more in the realm of hacking Textile. Nevertheless, it’s possible to add a “shorthand” notation that doesn’t qualify for a URI, for the sake of simplicity.

Keep the suggestions coming.

Last edited by Etz Haim (2005-10-27 21:37:31)

Offline

#5 2005-10-27 23:16:12

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [plugin] [ORPHAN] etz_pseudo

Etz Haim wrote:
This is an attempt to define a standard, possibly like XPointer, for all the TXP sites using it regardless of their locale.

Sorry then, I didn’t understood that. And well, I still don’t. The Wikipedia’s Xpointer page doesn’t say much, at all.

What are you try to achieve, if not a way for an author to link to things ?

What would happen if a “french-speaking” host linked to a greek- or english-speaking host via a txp:// pseudo-URI? The reason that I’m asking is because I actually have plans to introduce such a feature.

I don’t understand that either. Let’s say I want to link to a Rob Sable’s article. Well, it has some URL, so I will hyperlink to it. Well, like any other link, from day 1 of the web.

I’m sure I’m missing something critical here…

Offline

#6 2005-10-28 00:01:11

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [plugin] [ORPHAN] etz_pseudo

> Etz Haim wrote:
@hakjoon: The txp:// pseudo-URIs are “semantic” entities and carry a certain meaning on their own, regardless if they are used inside XHTML, Textile, Markdown, or anything else. What you are suggesting is more in the realm of hacking Textile. Nevertheless, it’s possible to add a “shorthand” notation that doesn’t qualify for a URI, for the sake of simplicity.

I think I get what you are trying to do with the pseudo-URIs and I like the fact that it isn’t tied to textile, etc. In fact I think it’s a fantastic idea and a great approach. I guess my samples where just using textile, because I was bringing them over from the other thread.

The point that I was trying to make was more that I can’t copy txp://rob-sable-host/article/56 , throw it in my address bar and have it get me anywhere. So I guess what I was trying to express was maybe use a syntax that didn’t look so much like a web address to the untrained user might be better. The Smarty and Markdown samples were more just to point to approaches used by other “languages” to define URIs


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB