Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-06-18 18:59:46
- alexwest
- Member
- From: Järna, Sweden
- Registered: 2004-08-04
- Posts: 53
URL-only title
Is there any tag or plugin to disply the content of the “URL-only title” field of an article?
Thx
be safe and happy
Offline
#2 2005-06-18 21:18:33
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: URL-only title
If you add this
<code>
function url_title($atts)
{
global $thisarticle;
return $thisarticle[‘url_title’];
}
</code>
<br />to taghandlers.php, you’ve got a tag <code><txp:url_title /></code>.
<br />[Edit] You can also make it into a plugin, if you don’t want to have to modify that file every time you upgrade.
Last edited by doggiez (2005-06-18 21:20:32)
Offline
Re: URL-only title
This mod should make its way into the official distro, IMO.
VC3 :: weblog :: my wishlist
Offline
#4 2005-07-27 17:57:09
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: URL-only title
What’s the use for this?
(This is an honest question, not a… challenge?)
Offline
Re: URL-only title
I think the same as Etz, indeed I think that a “feature” to be added would be the ability to use/access any individual field of the articles/links/files …
http://forum.textpattern.com/viewtopic.php?id=9836
thanks.
Offline
Re: URL-only title
mary, i used this a bit ago to create my own permlinks (needed to append an anchor to the end of the link)
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#7 2005-07-29 12:05:51
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: URL-only title
<txp:permlink />
should return the complete permlink URL only, without the link tags. Something like <a href="<txp:permlink />#foo">..
might do what you want.
Alex
Offline
Re: URL-only title
Assuming that returns the full URL, http://
and all, I’d still lobby for the ability to just pull out the URL-title. It’d be handy for tag-related things like Tagback or the related reading format I’ve been working on.
You cooin’ with my bird?
Offline
Re: URL-only title
What’s the use for this?
(This is an honest question, not a… challenge?)
I think this can be useful to add class/id to body/divs/etc and apply special CSS to a particular individual article.
Something like:
<body id="<txp:section />" class="<txp:url_title />">
That will output
<body id="articles" class="my-article-url">
And then add some specific rules in the CSS.
Offline
Offline
#11 2007-01-07 01:16:42
- jawtab
- New Member
- Registered: 2007-01-07
- Posts: 5
Re: URL-only title
I just tried this and followed the directions and added the code to the taghandlers.php in the include directory but am getting nothing.
Does this work in the latest version 4.04?
thanks in advance
Offline
#12 2007-01-07 02:46:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: URL-only title
It might help if you told us what you’re trying to do.
Last edited by Mary (2007-01-07 23:25:48)
Offline