Textpattern Forum

You are not logged in. Register | Login | Help

#1 2009-08-01 10:51:00

buzz27
New Member
Registered: 2009-08-01
Posts: 3

[textile] link title

Hi,

What is the correct syntax for creating a link in which an image links to a URL, and the link has a title?

ie:

[code]
<a href=“http://example.com” title=“Foo”><img src=”/image.jpg” alt=“Bar” /></a>
[/code]

I can see how to create a link with an image and alt text, but not how to add the title.

Also, is there a way to add the REL attribute to the link?

Thanks!

Offline

#2 2009-08-01 10:59:37

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,149
Website

Re: [textile] link title

This is an example:

<a rel="external" href="http://news.bbc.co.uk/" title="title here">text here</a>

Or another with pure Textile, but without the rel attribute:

"text(title)":http://news.bbc.co.uk/


TXP Tips | @txptips | Me | @jonathanstubbs | Github

TXP Builders – finely-crafted code, design and txp @txpbuilders

Offline

#3 2009-08-02 11:25:54

buzz27
New Member
Registered: 2009-08-01
Posts: 3

Re: [textile] link title

Thanks, but how do I create the title attribute in the link when there is an image in the anchor, instead of text?

Offline

#4 2009-08-02 12:38:52

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: [textile] link title

"!img!(title)":url

Or

"!img(title)!(title)":url

if you also want the img tag to have title and alt attributes with that value.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#5 2009-08-02 14:05:13

buzz27
New Member
Registered: 2009-08-01
Posts: 3

Re: [textile] link title

Perhaps I am making some mistake, but I can’t get either of those two examples to render using: http://textism.com/tools/textile/index.php

Any suggestions?

Offline

#6 2009-08-02 14:29:35

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: [textile] link title

Are you inputting the examples without quotation marks and with valid image and url sources?

Try this – it definitely works for me:

!http://www.capture-the-moment.co.uk/tp/images/567.jpg (Full frame Shoveller)!:http://www.bbc.co.uk

Last edited by keith (2009-08-02 14:33:42)


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#7 2009-08-02 14:31:17

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: [textile] link title

http://textile.thresholdstate.com/ uses a more up-to-date version of Textile. Both my examples work there. More to the point, they work in an actual Txp installation.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#8 2012-07-15 14:59:25

quicknquiet
Member
From: Moscow
Registered: 2012-07-02
Posts: 11

Re: [textile] link title

May be I went through documentation badly, but I have no idea how to put TITLE attribute to TXP link tags, for example <txp:permlink />

Offline

#9 2012-07-15 15:10:22

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,374
Website

Re: [textile] link title

Have a look at Example 3 in the tag reference.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB