Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-03 09:56:43

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Output custom field in PHP?

Do I have to use it’s PHP handle or will this work?

<txp:php>

 echo (@file_get_contents ("/home/username/public_html/events/<txp:custom_field name="FieldName" />"));

</txp:php>

Last edited by FireFusion (2007-07-03 09:56:54)

Offline

#2 2007-07-03 11:57:58

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Output custom field in PHP?

In php code you must replace txp tag by txp function

txp: custom_field become custom_field.

You can read this article to understund better.

A+

Offline

#3 2007-07-03 12:22:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Output custom field in PHP?

<txp:php>
  echo @file_get_contents('/home/username/public_html/events/'.custom_field(array('name' => 'FieldName')));
</txp:php>

Last edited by ruud (2007-07-03 12:23:23)

Offline

#4 2007-07-03 12:51:27

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: Output custom field in PHP?

Thank you. Just what I needed :)

Offline

Board footer

Powered by FluxBB