Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
txp:php and custom fields
I have some php include code that looks like this on an older version of TXP:
<?php include('http://www.domain.com/code.php?file=<txp:custom_field name="place" />'); ?>
I want to the site to a new version of TXP, which means using the txp:php tag, but it isn’t working. Here’s what I’ve tried:
<txp:php> include('http://www.domain.com/code.php?file=<txp:custom_field name="place" />'); </txp:php>
If I replace <txp:custom_field name=“place” /> with simply the place name, it works. That isn’t a solution, however… there are two thousand pages that use the custom field to define “place”.
How are custom fields used within <txp:php> tags?
Offline
Re: txp:php and custom fields
Hi, rah_external should be of help
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: txp:php and custom fields
You should parse
the tag, try
<txp:php> include(parse('http://www.domain.com/code.php?file=<txp:custom_field name="place" />')); </txp:php>
Offline
Re: txp:php and custom fields
etc wrote:
You should
parse
the tag, try
Tried that – same result. The custom field just isn’t outputting inside <txp:php> tags.
colak wrote:
Hi, rah_external should be of help
I may not understand rah_external. I thought it was for outputting something from TXP to be used on another site. In my application, I’m inserting external html content into a TXP page. Will it do that?
Offline
#5 2015-04-17 19:41:02
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,473
Re: txp:php and custom fields
What bout this?
<txp:php> include("http://www.domain.com/code.php?file=custom_field(array('name' => 'place'))"); </txp:php>
Offline
Re: txp:php and custom fields
GugUser wrote:
What bout this?
Tried it (thank you). The custom field still doesn’t output.
Offline
Re: txp:php and custom fields
towndock wrote #290104:
The custom field just isn’t outputting inside <txp:php> tags.
What do you get with
<txp:php> echo parse('http://www.domain.com/code.php?file=<txp:custom_field name="place" />'); </txp:php>
Edit: make sure you are in the article context (inside <txp:article />
or in some form). And it might be
<txp:php> include(urlencode(parse('http://www.domain.com/code.php?file=<txp:custom_field name="place" />'))); </txp:php>
Last edited by etc (2015-04-17 20:09:14)
Offline
Re: txp:php and custom fields
etc wrote:
What do you get with
I got exactly what it was supposed to be. So I went back to your example:
<txp:php> include(parse('http://www.domain.com/code.php?file=<txp:custom_field name="place" />')); </txp:php>
It works! (I must have fat fingered something on the initial try). Thank you much…
Offline
Pages: 1