OS Property support center
Extra Fields: OSProperty v2.0.4.3
- Garth Wilson
-
Topic Author
- Offline
- New Member
-
Less
More
11 years 8 months ago - 11 years 8 months ago #34034
by Garth Wilson
Extra Fields: OSProperty v2.0.4.3 was created by Garth Wilson
I am a PHP novice.
Our website was recently upgraded to Joomla 2.5.7 with OSProperty 2.0.4.3.
We are a commercial & industrial real estate (CRE) agency, website www.dunbar.co.za/new
We created extra fields for CRE being sub-type, gla (gross lettable area), land-size, yield and noi (net operating income).
We need to show these extra fields individually in different locations in the grid view e.g.:
Commercial Property for Sale 014
Office Block <sub-type> For Sale
R 6 100 000
Convert Currency:
GLA: <gla> , Land <land-size>
Yield: <yield>, NOI: <noi>
Vereeniging, Gauteng, South Africa
Category : SOLD - Agent: Garth Wilson
From other forum topic suggestions, we added code to grid.html.tpl.php:
Close to top...
<!-- START: Call to prepare extra fields -->
<?php
//convertArray to use ids as key
$extrafields = array();
foreach($item->extra_fields as $item)
{
$extrafields[$item->id] = $item->field_label;
}
?>
<!-- END: Call to prepare extra fields -->
And where we wanted to show the extra field...
<?php echo $extrafields[1];?> 1 being the ID for sub-type.
This does not work...
Any ideas?
Our website was recently upgraded to Joomla 2.5.7 with OSProperty 2.0.4.3.
We are a commercial & industrial real estate (CRE) agency, website www.dunbar.co.za/new
We created extra fields for CRE being sub-type, gla (gross lettable area), land-size, yield and noi (net operating income).
We need to show these extra fields individually in different locations in the grid view e.g.:
Commercial Property for Sale 014
Office Block <sub-type> For Sale
R 6 100 000
Convert Currency:
GLA: <gla> , Land <land-size>
Yield: <yield>, NOI: <noi>
Vereeniging, Gauteng, South Africa
Category : SOLD - Agent: Garth Wilson
From other forum topic suggestions, we added code to grid.html.tpl.php:
Close to top...
<!-- START: Call to prepare extra fields -->
<?php
//convertArray to use ids as key
$extrafields = array();
foreach($item->extra_fields as $item)
{
$extrafields[$item->id] = $item->field_label;
}
?>
<!-- END: Call to prepare extra fields -->
And where we wanted to show the extra field...
<?php echo $extrafields[1];?> 1 being the ID for sub-type.
This does not work...
Any ideas?
Last edit: 11 years 8 months ago by Garth Wilson. Reason: spelling error
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13024
- Thank you received: 1692
11 years 8 months ago #34042
by Mr. Dam
Replied by Mr. Dam on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi,
Of course, with that solution, it won't work.
If you want to show the value of extra field of one property at the list view (grid view), you can use the source code,
1. Find the id of the extra field (it's the unique number of each extra field, you can find it in the extra field management)
2. get the field object from id - $extrafield_id
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '$extrafield_id'");
$field = $db->loadObject();
3. Get data of the field in property
HelperOspropertyFields::showField($field,$pid);
$field: Custom field object
$pid : id of property
Good luck
Dam
Of course, with that solution, it won't work.
If you want to show the value of extra field of one property at the list view (grid view), you can use the source code,
1. Find the id of the extra field (it's the unique number of each extra field, you can find it in the extra field management)
2. get the field object from id - $extrafield_id
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '$extrafield_id'");
$field = $db->loadObject();
3. Get data of the field in property
HelperOspropertyFields::showField($field,$pid);
$field: Custom field object
$pid : id of property
Good luck
Dam
Please Log in or Create an account to join the conversation.
- Garth Wilson
-
Topic Author
- Offline
- New Member
-
11 years 8 months ago - 11 years 8 months ago #34079
by Garth Wilson
Replied by Garth Wilson on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi Dam
Apologies for my ignorance but tried whole day with variations to try get it to work.
Essentially I want to list extra fields for all properties in the grid view in different locations.
If I get code for one extra field, I will comfortably be able to duplicate for the rest.
The #__osrs_extra_fields db is as follows:
id : group_id : field_type : field_name : field_label
1 : 1 : text : gla : GLA
2 : 1 : text : land-size : Land Size
3 : 1 : text : yield : Yield
4 : 1 : text : sub-type : Sub-Type
5 : 1 : text : noi : NOI
This is what I entered in grid.html.tpl.php where I want to display 'sub-type' which is id '4';
<?php
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '$extrafield_id'");
$field = $db->loadObject();
HelperOspropertyFields::showField('4',$pid); ?>
I tried various alternatives for $pid...needs to be specific sub-type unique to each property.
Apologies for my ignorance but tried whole day with variations to try get it to work.
Essentially I want to list extra fields for all properties in the grid view in different locations.
If I get code for one extra field, I will comfortably be able to duplicate for the rest.
The #__osrs_extra_fields db is as follows:
id : group_id : field_type : field_name : field_label
1 : 1 : text : gla : GLA
2 : 1 : text : land-size : Land Size
3 : 1 : text : yield : Yield
4 : 1 : text : sub-type : Sub-Type
5 : 1 : text : noi : NOI
This is what I entered in grid.html.tpl.php where I want to display 'sub-type' which is id '4';
<?php
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '$extrafield_id'");
$field = $db->loadObject();
HelperOspropertyFields::showField('4',$pid); ?>
I tried various alternatives for $pid...needs to be specific sub-type unique to each property.
Last edit: 11 years 8 months ago by Garth Wilson. Reason: spacing
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13024
- Thank you received: 1692
11 years 8 months ago #34092
by Mr. Dam
Replied by Mr. Dam on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi,
In case you want to retrieve data of field with id = 4, you need modify the source like bellow
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '4'");
$field = $db->loadObject();
HelperOspropertyFields::showField($field,$pid); ?>
$pid is the id of property, maybe 1 or 2 or 3 v.v. In the list or grid view, $pid is $row->id
Thanks
Dam
In case you want to retrieve data of field with id = 4, you need modify the source like bellow
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '4'");
$field = $db->loadObject();
HelperOspropertyFields::showField($field,$pid); ?>
$pid is the id of property, maybe 1 or 2 or 3 v.v. In the list or grid view, $pid is $row->id
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Garth Wilson
-
Topic Author
- Offline
- New Member
-
11 years 8 months ago #34106
by Garth Wilson
Replied by Garth Wilson on topic Re: Extra Fields: OSProperty v2.0.4.3
Muchas gracias, Dam...she works!
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '4'");
$field = $db->loadObject();
HelperOspropertyFields::showField($field,$row->id);
$db = JFactory::getDBO();
$db->setQuery("Select * from #__osrs_extra_fields where id = '4'");
$field = $db->loadObject();
HelperOspropertyFields::showField($field,$row->id);
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13024
- Thank you received: 1692
11 years 8 months ago #34110
by Mr. Dam
Replied by Mr. Dam on topic Re: Extra Fields: OSProperty v2.0.4.3
Configuration

Please Log in or Create an account to join the conversation.
- Marios
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 0
11 years 8 months ago #34181
by Marios
Replied by Marios on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi,
Is it possible to remove the Text Box surrounding the extra field?
Thanx
Is it possible to remove the Text Box surrounding the extra field?
Thanx
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13024
- Thank you received: 1692
11 years 8 months ago #34192
by Mr. Dam
Replied by Mr. Dam on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi Marios,
can you explain more details your question? photo attach is welcome
Thanks
Dam
can you explain more details your question? photo attach is welcome
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Garth Wilson
-
Topic Author
- Offline
- New Member
-
11 years 8 months ago - 11 years 8 months ago #34207
by Garth Wilson
Replied by Garth Wilson on topic Re: Extra Fields: OSProperty v2.0.4.3
Attachments:
Last edit: 11 years 8 months ago by Garth Wilson. Reason: spelling
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13024
- Thank you received: 1692
11 years 8 months ago #34208
by Mr. Dam
Replied by Mr. Dam on topic Re: Extra Fields: OSProperty v2.0.4.3
Hi,
Please try to replace
HelperOspropertyFields::showField($field,$row->id);
by
HelperOspropertyFieldsPrint::showField($field,$row->id);
Good luck
Dam
Please try to replace
HelperOspropertyFields::showField($field,$row->id);
by
HelperOspropertyFieldsPrint::showField($field,$row->id);
Good luck
Dam
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam, Nguyen Phu Quan
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.