Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-22 01:01:55

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

add a title to txp:link_to_prev

How do I add a title attribute to <txp:link_to_prev> and <txp:link_to_next>?

i.e. so the url ends up being something like this: <a href="www.example.com/article/12/title" title="Article Title">Next Article</a>

I’m stumped!

Last edited by mikeg (2006-01-22 01:03:58)


“I love Beethoven. Especially the poems.”
- Ringo Starr

Offline

#2 2006-01-22 02:25:11

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: add a title to txp:link_to_prev

The tags you mention will already output the article’s title by default but they can only be used for the “individual_article” view, which is normally where your comments and comment entry form are shown. If you are talking about the front-page (default) then you have to use the <code><txp:newer>Next</txp:newer></code> and <code><txp:older>Previous</txp:older></code> tags as the front-page is an “article_list” so you are in “paging” mode which means you can’t call an individual article.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2006-01-22 02:37:51

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

Re: add a title to txp:link_to_prev

Thanks for the response.

I guess I should explain a little better.

I’m building a photoblog and want to use <txp:link_to_prev> like so (on the default [front] page):

<txp:link_to_prev><txp:article_image /></txp:link_to_prev>

<p>This generates exactly what I want (the photo on the front page is hyperlinked to the previous photo’s individual archive page), EXCEPT FOR a title attribute on the a tag. I dove into the source code, just to see if it would be easy to add title="click for previous photo" somewhere, but no dice.</p>

Any ideas?

Last edited by mikeg (2006-01-22 02:38:12)


“I love Beethoven. Especially the poems.”
- Ringo Starr

Offline

#4 2006-01-22 02:39:37

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: add a title to txp:link_to_prev

Ah I see. Let me see if I can find it.

The 2 tags are in /publish/taghandlers.php but looking at the code I’m not sure how you would do that. My php isn’t too good though. Well not this week. :)

Last edited by thebombsite (2006-01-22 02:47:37)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2006-01-22 03:06:47

mikeg
Member
From: Edmonton, Canada.
Registered: 2005-02-21
Posts: 31
Website

Re: add a title to txp:link_to_prev

Thanks, man. I’ll tinker with it for a bit, see what i come up with.


“I love Beethoven. Especially the poems.”
- Ringo Starr

Offline

Board footer

Powered by FluxBB