× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Accessing field content with PHP in template

More
9 years 8 months ago #2956 by ray
Hi,

I have installed phpdirect in Joomla and am trying to use PHP to re-format the output of a text field in my template as follows...

<?php echo nl2br({joodb field|text});?>

...but it's not working. The {joodb field|text} does not seem to resolve to the field contents within the php code.

Is there a way of accessing the field contents within php in the templates?

Thanks,

Ray

Please Log in to join the conversation.

More
9 years 8 months ago #2957 by Dirk
The PRO Version has a plugin system.
Via plugin you can design your own custom commands.
For example to have a nl2br function create a nl2br.php in the component plugins folder
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
$output .= nl2br($item->{$part->parameter[0]});
?>
With {joodb nl2br|FIELDNAME} you can now output every field with nl2br.

Without pro you could try to use javascript to replace content.

Please Log in to join the conversation.

Moderators: Dirkjoest