Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-29 11:21:57

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

how to echo html tags in title

I’ve a title: (This is <br /> testing title)
when i run <txp:title /> it will output to: This is <br />testing title
how i can run html tags as well, to output like this=>
This is
testing title

thank you

Last edited by raminrahimi (2016-05-29 11:23:01)

Offline

#2 2016-05-29 11:40:48

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: how to echo html tags in title

raminrahimi wrote #299356:

I’ve a title: (This is <br /> testing title)…

Try something like <txp:custom_field name="Title" escape="" /> .
Each field in the write tab can be called through the custom field tag.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#3 2016-05-29 12:53:09

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: how to echo html tags in title

What you can also do is insert a break-character such as | or ### into the title field and then use a replace plugin to replace that character, either with nothing when not needed, or with a <br> or <wbr>, e.g.

<txp:smd_wrap transform="replace|string|###|<br>"><txp:title /></txp:smd_wrap>

(Note: if you use a pipe (|) in your title field, you need to change the param_delim in smd_wrap).


TXP Builders – finely-crafted code, design and txp

Offline

#4 2016-05-31 09:15:50

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 276

Re: how to echo html tags in title

NicolasGraph wrote #299357:

Try something like <txp:custom_field name="Title" escape="" /> .
Each field in the write tab can be called through the custom field tag.

Works perfect, thank you :-)

Offline

Board footer

Powered by FluxBB