Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-08 09:54:13

freshface
Member
Registered: 2006-08-23
Posts: 49

Can I use php in article_custom?

Like this:
<code>
<txp:article_custom category=”<?php $x = $_GET[‘x’]; echo $x; ?>” sortby=“Posted” sortdir=“desc” form=“wab_featured_artists” listform=“wab_featured_artist” limit=“1” />
</code>

Offline

#2 2006-09-08 10:11:14

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

Re: Can I use php in article_custom?

I assume you tried and it didn’t work. Try this:
<code><txp:php>echo article_custom(array(‘category’ => gps(‘x’), ‘sortby’ => ‘Posted’, ‘sortdir’ => ‘desc’, ‘form’ => ‘wab_featured_artists’, ‘listform’ => ‘wab_featured_artist’, ‘limit’ => ‘1’)); </txp:php></code>

Offline

#3 2006-09-08 10:12:21

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Can I use php in article_custom?

No. Use of php-style delimiters is deprecated anyhow (in favour of txp:php tyle tags). And there’s an entry in the FAQ about using tags as attributes, commonly described as “tags in tags”.

Offline

#4 2006-09-08 10:14:54

freshface
Member
Registered: 2006-08-23
Posts: 49

Re: Can I use php in article_custom?

Sweet Ruud, works like a charm!

Offline

#5 2006-09-08 10:15:24

freshface
Member
Registered: 2006-08-23
Posts: 49

Re: Can I use php in article_custom?

I will check it out sencer.

Offline

Board footer

Powered by FluxBB