Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services
OS Property support center

Echo specificity extra field

More
10 years 8 months ago - 10 years 8 months ago #74135 by Ivan
Echo specificity extra field was created by Ivan
How do I print a specific field in a template? Now displays all fields.
I found in forum this HelperOspropertyFieldsPrint::showField($field,2);
I write this in this file listing.html.tpl.php.
But why then the field will not be displayed.
Please help me.
Last edit: 10 years 8 months ago by Ivan.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74141 by Mr. Dam
Replied by Mr. Dam on topic Echo specificity extra field
Hi Ivan,
You should get data of custom field and pass it into variable: $field
Thanks
Dam

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74142 by Ivan
Replied by Ivan on topic Echo specificity extra field
So ?
<?php
$field = $db->loadObject();
HelperOspropertyFieldsPrint::showField($field,2);
?>

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74171 by Ivan
Replied by Ivan on topic Echo specificity extra field
tell me what am I doing wrong?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74176 by Mr. Dam
Replied by Mr. Dam on topic Echo specificity extra field
Hi Ivan,
You should have:
Code:
$db = JFactory::getDbo(); $db->setQuery("Select * from #__osrs_extra_fields where id = 'XXX'"); $fields = $db->loadObject(); ....
XXX is ID of extra field

Thanks
Dam

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74181 by Ivan
Replied by Ivan on topic Echo specificity extra field
I for some reason does not appear, maybe I'm doing something wrong?

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #74183 by Ivan
Replied by Ivan on topic Echo specificity extra field
I understand that the $ pid tid is a particular object, but I want it to output field for all objects.
I have no output :(

Please Log in or Create an account to join the conversation.

Moderators: Mr. Dam, Nguyen Phu Quan