Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
Re: fetch article using title
is that a no?
;)
Offline
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
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)
Morgan Aldridge
http://www.makkintosshu.com/
Offline
Re: fetch article using title
morgant, try this for size :)
Offline
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)
Morgan Aldridge
http://www.makkintosshu.com/
Offline
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
Re: fetch article using title
I can indeed – thanks for the tip.
Offline
Pages: 1