- Posts: 4
- Thank you received: 0
OS Property support center
Retrieve State Value
- Gabriele Godano
- Topic Author
- Offline
- New Member
-
Less
More
8 years 5 months ago - 8 years 5 months ago #91494
by Gabriele Godano
Retrieve State Value was created by Gabriele Godano
Hello, I've a question: I need to retrieve the value from the state field in property.html.php file;
I've tried to echo the value from the state row but it displays the id number of the field;
Is there a way to return the selected state_name? Something like <?php $row->state_name?> for example?
I see that from the $lists i can print the selected state_name but followed by an hidden input, how can I strip the input so i get only the state_name?
Thank you so much
Gabriele
I've tried to echo the value from the state row but it displays the id number of the field;
Is there a way to return the selected state_name? Something like <?php $row->state_name?> for example?
I see that from the $lists i can print the selected state_name but followed by an hidden input, how can I strip the input so i get only the state_name?
Thank you so much
Gabriele
Last edit: 8 years 5 months ago by Gabriele Godano.
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
8 years 4 months ago #91514
by Mr. Dam
Replied by Mr. Dam on topic Retrieve State Value
Hi Gabriele,
What's the function in file: property.html.php that you want to show State name variable so i can suggest you the solution
Thanks
Dam
What's the function in file: property.html.php that you want to show State name variable so i can suggest you the solution
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Gabriele Godano
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
8 years 4 months ago - 8 years 4 months ago #91591
by Gabriele Godano
Replied by Gabriele Godano on topic Retrieve State Value
Hello Dang,
thank you for your quick answer. I want to be able to insert automatically the full address field inside the google map latitude and longitude input so the user, after saving the property, will find the address already written.
I've successfully insert the $row->address; inside the input field. Unfortunately this is not enough cause in Italy many cities have the same street name so google points out the first that find in the country. For this reason i need to specify the city.
In Italy we use different kind of address format to identify a place.
The system default refers to United States so: Country / State / City.
In Italy we can't use that format cause we don't have states inside the country but we need to specify the district inside the city.
So I've converted the State/Provinces into Cities and Cities into Districts.
Everything seems to work fine with it, I already read a discussion about this here in the form and you suggested this solution so I've already applied it
But now I'm facing formatting problems and data selection customizing problems.
I need to print out the selected state_name value (in php is state_name but in front end is the city name);
And also i need to change the full address format, because now I display: Address/ District name / City / Zip code, instead of: Address / City / District Name;
One last question: I want to display a small property search at the top of property listing page. I've created it using the search properties module. But there's one problem I just want to display it on listing page and not into the single property page. Is there a way to insert the module only in the property listing? From the Joomla module assignment i can only check the property listing page, but i have no control on it inside OSProperties component.
I've seen that there's an option inside the configuration called "show search module" under the Layout / List property section. I tried to activate it but nothing shows in the listing page.
Sorry for the huge amount of questions!
I hope you can understand all the passages
I've made attachments to explain my situation in a better way.
Thank you so much for your help and your work!
Gabriele
thank you for your quick answer. I want to be able to insert automatically the full address field inside the google map latitude and longitude input so the user, after saving the property, will find the address already written.
I've successfully insert the $row->address; inside the input field. Unfortunately this is not enough cause in Italy many cities have the same street name so google points out the first that find in the country. For this reason i need to specify the city.
In Italy we use different kind of address format to identify a place.
The system default refers to United States so: Country / State / City.
In Italy we can't use that format cause we don't have states inside the country but we need to specify the district inside the city.
So I've converted the State/Provinces into Cities and Cities into Districts.
Everything seems to work fine with it, I already read a discussion about this here in the form and you suggested this solution so I've already applied it

But now I'm facing formatting problems and data selection customizing problems.
I need to print out the selected state_name value (in php is state_name but in front end is the city name);
And also i need to change the full address format, because now I display: Address/ District name / City / Zip code, instead of: Address / City / District Name;
One last question: I want to display a small property search at the top of property listing page. I've created it using the search properties module. But there's one problem I just want to display it on listing page and not into the single property page. Is there a way to insert the module only in the property listing? From the Joomla module assignment i can only check the property listing page, but i have no control on it inside OSProperties component.
I've seen that there's an option inside the configuration called "show search module" under the Layout / List property section. I tried to activate it but nothing shows in the listing page.
Sorry for the huge amount of questions!
I hope you can understand all the passages

Thank you so much for your help and your work!
Gabriele
Attachments:
Last edit: 8 years 4 months ago by Gabriele Godano.
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
8 years 4 months ago #91616
by Mr. Dam
Replied by Mr. Dam on topic Retrieve State Value
Hi,
Where do you want to show State_name at front-end ?
1. Open file:
root > administrator > components > com_osproperty > classes > configuration > properties > property.php
2. Find:
You can add option to change the values of Address format if you want.
In Properties listing page, we have the filter form. When you add menu to layout: Property Listing layout, there is the parameter to show Filter form.
Thanks
Dam
Where do you want to show State_name at front-end ?
To change the Address format, please follow these stepsI need to print out the selected state_name value (in php is state_name but in front end is the city name);
1. Open file:
root > administrator > components > com_osproperty > classes > configuration > properties > property.php
2. Find:
Code:
$addressArr = array();
$addressArr[0] = JText::_('OS_ADDRESS');
$addressArr[1] = JText::_('OS_CITY');
$addressArr[2] = JText::_('OS_STATE');
$addressArr[3] = JText::_('OS_REGION');
$addressArr[4] = JText::_('OS_POSTCODE');
$optionArr = array();
$optionArr[0] = "0,1,2,3,4";
$optionArr[1] = "0,1,4,2,3";
$optionArr[2] = "0,1,4,3,2";
$optionArr[3] = "0,1,3,4,2";
$optionArr[4] = "0,1,3,2,4";
$optionArr[5] = "0,1,2,4,3";
You can add option to change the values of Address format if you want.
In Properties listing page, we have the filter form. When you add menu to layout: Property Listing layout, there is the parameter to show Filter form.
Thanks
Dam
The following user(s) said Thank You: Gabriele Godano
Please Log in or Create an account to join the conversation.
- Gabriele Godano
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
8 years 4 months ago #91781
by Gabriele Godano
Replied by Gabriele Godano on topic Retrieve State Value
Thank you again Dan for your quick help! 
Now I've a final question for you.
Our client wants the Properties Back-end looking similar to his external properties system manager so when he is going to add a new property the fields in back-end are the same of what he's used to see.
To achieve that I need to customize the property.html.php moving existing tabs and creating different groups of extra fields to display in back and front-end.
The problem is that i need to manage extra custom fields separately.
For example i create a new extra field group called "Tipologia proprietà "
Then, i'm going to create a single dropdown list of extra fields linked to the group.
Now, if i'm going to create a new property i see the new group with extra field single dropdown inside of it before the photo add section.
(Attachment 1)
What if i want this dropdown list to be after the Address field in General information section for example?
I've looked inside the property.html.php and found this piece of code:
How can I get one specific extra field group (I've created many) and move it independently to another section for example general informations in the back end?
How can i achieve the same thing in the front-end?
In other words how i can control different extra field one by one?
Thank you so much again!
Gabriele

Now I've a final question for you.
Our client wants the Properties Back-end looking similar to his external properties system manager so when he is going to add a new property the fields in back-end are the same of what he's used to see.
To achieve that I need to customize the property.html.php moving existing tabs and creating different groups of extra fields to display in back and front-end.
The problem is that i need to manage extra custom fields separately.
For example i create a new extra field group called "Tipologia proprietà "
Then, i'm going to create a single dropdown list of extra fields linked to the group.
Now, if i'm going to create a new property i see the new group with extra field single dropdown inside of it before the photo add section.
(Attachment 1)
What if i want this dropdown list to be after the Address field in General information section for example?
I've looked inside the property.html.php and found this piece of code:
Code:
<?php
//echo $pane->endPanel();
$fieldLists = array();
if(count($groups) > 0){
for($i=0;$i<count($groups);$i++){
$group = $groups[$i];
$fields = $group->fields;
echo JHtml::_('sliders.panel', $group->group_name,strtolower(str_replace(" ","",$group->group_name)));
?>
<div class="row-fluid">
<?php
if(count($fields) > 0){
for($j=0;$j<count($fields);$j++){
$field = $fields[$j];
$fieldLists[] = $field->id;
if($field->required == 1){
//$require_field .= $field->field_name.",";
//$require_label .= $field->field_label.",";
}
if(intval($row->id) == 0){
$display = "display:none;";
}else{
$db->setQuery("Select count(fid) from #__osrs_extra_field_types where type_id = '$row->pro_type' and fid = '$field->id'");
$count = $db->loadResult();
if($count > 0){
$display = "";
}else{
$display = "display:none;";
}
}
?>
<div class="span12" id="extrafield_<?php echo $field->id?>" style="margin-left:0px;<?php echo $display;?>">
<div class="span4" style="margin-left:0px;">
<?php echo $field->field_label?>
</div>
<div class="span8" style="margin-left:0px;">
<?php
HelperOspropertyFields::showField($field,$row->id);
?>
</div>
</div>
<div class="clearfix"></div>
<?php
}
}
?>
</div>
<?php
}
}
How can I get one specific extra field group (I've created many) and move it independently to another section for example general informations in the back end?
How can i achieve the same thing in the front-end?
In other words how i can control different extra field one by one?
Thank you so much again!
Gabriele
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.