Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-07-19 02:28:56

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 66
Website Twitter

Find links to other articles from article screen?

Say I’m writing an article and want to link to a second article. Is there an easy way to find the second article’s URL without leaving the write tab?

I thought there was a plugin that let you do things like that, but I can’t find one.

Offline

#2 2023-07-19 06:01:26

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Find links to other articles from article screen?

Hi.

Why not to use this tag? Into your article body (Textile format):

<txp:permlink id="94" title="Read article...">Article...</txp:permlink>

Change id attribute with the desired article unique identifier (maybe the previous one; see documentation here).

Are you looking for this plugin? wet_quicklink

Last edited by Pat64 (2023-07-19 06:14:20)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#3 2023-07-19 10:14:39

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

Re: Find links to other articles from article screen?

An even better route might be to make a shortcode. That encapsulates everything so if the method of access changes or you want to alter or style the links you can do it in a single place.

But yes, the quicklink plugin is a good alternative.


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 2023-07-19 21:12:22

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 66
Website Twitter

Re: Find links to other articles from article screen?

Pat64 wrote:

Are you looking for this plugin? wet_quicklink

That’s the one! But looks like it’s not maintained anymore. <sad trombone>

Offline

#5 2023-07-20 04:32:52

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: Find links to other articles from article screen?

Bloke wrote #335572:

An even better route might be to make a shortcode. That encapsulates everything so if the method of access changes or you want to alter or style the links you can do it in a single place.

So, maybe you could use this (form name link):

<txp:if_yield name="id"><a rel="bookmark" href="<txp:permlink id='<txp:yield name="id" />' />"<txp:if_yield name="tooltip"> title="<txp:yield name="tooltip" />"</txp:if_yield>><txp:if_yield name="title"><txp:yield name="title" /></txp:if_yield></a>
</txp:if_yield>

Usage: <txp::link id="99" tooltip="Read" title="Article 99" />


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2023-07-20 17:25:59

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

Re: Find links to other articles from article screen?

Yeah, or embellish it slightly with some default goodness:

<if::yield name="id">
   <a rel="bookmark" href="<txp:permlink id='<txp:yield name="id" />' />"<if::yield name="tooltip"> title="<txp:yield name="tooltip" />"</if::yield>>
      <article::custom id='<txp:yield name="id" />'><txp:yield name="title" default='<txp:title />' /></article::custom>
   </a>
</if::yield>

That will default to the actual article title if you don’t specify one to override the link text. Untested, but something like that should work.


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

Board footer

Powered by FluxBB