Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-18 06:03:35

cade
New Member
From: Wagga Wagga, Australia
Registered: 2006-12-18
Posts: 7
Website

How do I link to another article from within an article?

Is there an easy way to link to another existing article from within an article, without having to hardcode the link? I don’t want to hardcode the link in case I change the url structure from messy to clean.

I would think there would be an easy way to do this, but I can’t seem to figure it out.

I am hoping there is a plugin or something that can generate a list of all articles that I can see whilst editing an article. Then I can just click on it to add a link to an article.

Offline

#2 2006-12-18 08:10:10

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: How do I link to another article from within an article?

You might want to try zem_link. You can make it build the link using the Article ID and that remains the same regardless of url structure.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2006-12-18 08:54:19

cade
New Member
From: Wagga Wagga, Australia
Registered: 2006-12-18
Posts: 7
Website

Re: How do I link to another article from within an article?

Ah ok, that does work, but I’m surprised there’s nothing something more user-friendly than that. Cheers!

Offline

#4 2006-12-18 14:32:47

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

Re: How do I link to another article from within an article?

<txp:permlink id="xx" /> (TextBook).

Edit: actually the single tag only outputs the url, so you’d have to do something like

<a href="<txp:permlink id="xx" />">Link text</a>

The container tag does produce a link:

<txp:permlink id="xx">link text</txp:permlink>

The first line of code has the advantage that you can add title, class and other attributes.

Last edited by els (2006-12-18 14:44:34)

Offline

#5 2006-12-18 21:48:18

cade
New Member
From: Wagga Wagga, Australia
Registered: 2006-12-18
Posts: 7
Website

Re: How do I link to another article from within an article?

OK.

What I was hoping for was for the admin interface to display a list of all other articles. All the user would need to do is highlight some text in their article, and click an article from the list to generate a hyperlink to it, using the highlighted text as the text link.

Sounds like there’s nothing around that is that user-friendly.

Offline

#6 2006-12-18 22:14:56

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

Re: How do I link to another article from within an article?

cade wrote:

Sounds like there’s nothing around that is that user-friendly.

Unfortunately there isn’t. You’d have to create or request a plugin.

Offline

Board footer

Powered by FluxBB