Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-04 14:17:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

[textile] Multiple links in one place

I might be going about this the wrong way but I’d like to use standard "textile links":link-shortcut to generate links to one or two other articles in my site. If I write a new article and want to link to it from some older articles I don’t particularly want to have to go through each old article and add:

[link-shortcut]:/path/to/my/article

just so I can refer to the article in question.

I thought I’d be clever and store them all in a form, then just call that form in my Default form or my page head or somewhere so all the textile shortcuts can be “loaded” along with every article and the links generated. Sadly, this doesn’t seem to work as (I assume) the Textile conversion that reads the links is done when the article is saved to body_html, not when it’s rendered.

Can anyone think of a way I can ‘include’ all my links somehow in all articles so I can cross-post using standard textile link syntax? Anything devious anyone can think of? Thanks in advance.

[ P.S. my primary motiviation for this is is because all the links are currently to a subdirectory install, and I want to be able to replace them all in one go when the site moves to its final (non-subdir) resting place ]

EDIT: yeah, yeah wet_quicklinx, I know… but I’m a keyboard geek :-)

Last edited by Bloke (2009-09-04 14:22:28)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2009-09-04 14:41:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,028
Website GitHub Mastodon Twitter

Re: [textile] Multiple links in one place

doesn’t "link":/id/article_title work? Or any other permanent link mode variation you use?

Alternatively did you think of using the “links” tab? Save a few links in there, call them using @<txp:link id=“2” />@ OK this does not exist but something similar is out there somewhere etc… When the site moves to its resting place, go back to the links tab and change the links there.

Last edited by colak (2009-09-04 14:45:25)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-09-04 15:01:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

Re: [textile] Multiple links in one place

colak wrote:

doesn’t "link":/id/article_title work? Or any other permanent link mode variation you use?

Kind of. I’m using section/title so "link":/section/article_title gives a 404 (because of the subdir). I suppose I could just use "link":section/article_title but I’m always nervous about those because I’m sure I’ve had fun where the links go to the wrong place depending if you’re on a list or an individual article or in a different section. But it appears to work now so maybe I was wrong about that.

As a sidenote, I would probably feel better if I could do this:

[article-title]:<txp:site_url />section/article_title

but that doesn’t work.

Alternatively did you think of using the “links” tab?

No, good idea. I suppose I could educate the other users to use the link syntax instead of Textile; it’s a bit messier. Or maybe I’ll just stick with your original suggestion and hard-code the section in the links.

I should probably fill you in on a secret: I was planning on using a little script that generates the links to all articles such that every article could be referenced by "link me":to-the-article-title, hence my desire to keep them all in one place and just update them when new articles are published. But if I can’t do that and they really must be embedded in each article I’ll abandon the idea and do it as you suggested above. Or use wet_quicklinx! Thanks for the tip.

Last edited by Bloke (2009-09-04 15:05:21)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2009-09-04 15:14:59

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

Re: [textile] Multiple links in one place

Could the last example here help you in your journey?

What about (ab)using this plugin by this guy?

Sorry, I wanted to mean: this guy

Last edited by maniqui (2009-09-04 15:16:09)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2009-09-04 15:24:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,279
Website GitHub

Re: [textile] Multiple links in one place

maniqui wrote:

Could the last example here help you in your journey?

The last example is what I’m trying to create, yes. But in a form instead of embedded in every article because I type enough already and want to potentially reuse the links to every article in every other article. Looks like I’m going to have to use the mouse and install wet_quicklinx ;-)

smd_short_url is a possibility if I could remember every single ID number… I’m more likely to remember the article title than its ID!

Last edited by Bloke (2009-09-04 15:24:57)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2009-09-04 20:55:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [textile] Multiple links in one place

Bloke wrote:

I thought I’d be clever and store them all in a form, then just call that form in my Default form or my page head or somewhere so all the textile shortcuts can be “loaded” along with every article and the links generated. Sadly, this doesn’t seem to work as (I assume) the Textile conversion that reads the links is done when the article is saved to body_html, not when it’s rendered.

Have you thought about using upm_textile? Or wouldn’t that work for the same reason?

Last edited by els (2009-09-04 20:56:45)

Offline

Board footer

Powered by FluxBB