Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-09 02:13:24

steffen
Member
Registered: 2009-12-13
Posts: 17

<txp:image /> tags in custom fields

hey.

i created textarea-customfields with glz_custom_fields. i use them like additional <txp:body /> fields.

-

<txp:image /> tags in these customfields will not be converted into <img> tags. how do i make this possible?

-

at the moment i use the plugin rah_replace to make it work, but it’s of course a horrible solution. there has to be a plugin for that, but all i found was upm_textile. (which does not solve my problem eventhough it should parse textpattern tags. it parses only the <txp:custom_field /> tag)

-

thanks for your time,
steffen

Last edited by steffen (2010-08-09 02:34:31)

Offline

#2 2010-08-09 02:59:25

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: <txp:image /> tags in custom fields

By default the custom fields output is escaped and custom_field tags itself don’t run parser before escaping. Basically the content isn’t parsed at all.

By using escape attribute of custom_field, the escaping can be avoided:

<txp:custom_field name="myfield" escape="" />

With the current parser that should do it as long as the outer block runs the parser.

Offline

#3 2010-08-09 03:19:55

steffen
Member
Registered: 2009-12-13
Posts: 17

Re: <txp:image /> tags in custom fields

first, thanks for all your plug-ins. very useful.

-

i am afraid it does not work. now the <txp:image /> is just in the source code, but it is still a textpattern-tag and not a regular <img> tag. :/

Offline

#4 2010-08-09 03:46:01

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: <txp:image /> tags in custom fields

steffen wrote:

first, thanks for all your plug-ins. very useful.

Thanks :-)

i am afraid it does not work. now the <txp:image /> is just in the source code, but it is still a textpattern-tag and not a regular <img> tag. :/

Then you would probably need to call the parser. You could try rah_function:

<txp:rah_function call="parse" content='<txp:custom_field name="myfield" escape="" />' />

Or with raw PHP:

<txp:php>
	echo parse(
		custom_field(array(
			'name' => 'myfield'
		))
	);
</txp:php>

Last edited by Gocom (2010-08-09 03:49:15)

Offline

#5 2010-08-09 03:58:05

steffen
Member
Registered: 2009-12-13
Posts: 17

Re: <txp:image /> tags in custom fields

thanks, this works. i use rah_function, i like that solution. now i also know how to parse included php files in forms.

Offline

Board footer

Powered by FluxBB