Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-31 16:09:41

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

fetch article using title

hello
I wish to be able to target an article by specifying the article title….

I realise it’s possible to use the article ID as an attribute of article_custom <code><article_custom id=“7” /></code>
but is there a plugin which enables you to write something similar to <code><article_custom title=“article title” /></code>?

Offline

#2 2006-02-02 14:14:40

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: fetch article using title

is that a no?

;)

Offline

#3 2006-12-01 17:02:16

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: fetch article using title

I find myself needing to do this again… anybody know if it’s possible?

Offline

#4 2006-12-01 19:57:23

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: fetch article using title

This would indeed be a welcome addition, i would even venture to say it belongs in the core..

who the hell can ever remember those IDs?

Offline

#5 2006-12-03 23:10:11

morgant
Plugin Author
From: Vermont, United States
Registered: 2004-06-22
Posts: 63
Website

Re: fetch article using title

I’m looking to do this as I have some sections in my site (e.g. about, contact, etc.) which I post articles to that don’t have/need permalinks, but I want to provide an anchor to them to allow people to link directly to them (e.g. /about#colophon).

Is there a way to do this other than using the article ID? Is there a plug-in that can do this or does one need to be written?

Update: I guess what I’m actually looking for is something that functions like <txp:article_id />, but returns a Clean URL style article reference (e.g. my-excellent-article-title) as opposed to the numerical article ID (e.g. 42). Any way to do this?

Last edited by morgant (2006-12-04 02:49:06)

Offline

#6 2006-12-04 18:26:09

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: fetch article using title

morgant, try this for size :)

Offline

#7 2006-12-12 06:50:44

morgant
Plugin Author
From: Vermont, United States
Registered: 2004-06-22
Posts: 63
Website

Re: fetch article using title

Thanks for pointing me to that. Exactly what I was looking for!

I ended up writing a quick plug-in to implement that, then discovered that there’s now the <article_url_title /> tag (only added to Textbook on December 1st) as of 4.0.5 (I’m still on 4.0.3, there’s really no excuse for not upgrading).

Of course, I still prefer the syntax of my single tag for both article ID & URL title functionalities… c’est la vie!

Last edited by morgant (2006-12-12 06:55:03)

Offline

#8 2008-10-23 13:58:04

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: fetch article using title

This is weird – 2.5 years later I find my own post in some search results as I find myself needing to do the same thing again!

Anybody had any brainwaves since Dec 2006?

:)

Offline

#9 2008-10-24 00:12:26

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

Re: fetch article using title

If I understand correctly, I think you should be able to achieve what you want with smd_query

Offline

#10 2008-10-24 12:03:53

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: fetch article using title

I can indeed – thanks for the tip.

Offline

Board footer

Powered by FluxBB