- Posts: 4
- Thank you received: 0
OS Property support center
Get name and value of extra field in custom theme
- Bettina Steffan
- Topic Author
- Offline
- New Member
-
Less
More
9 years 11 months ago #64265
by Bettina Steffan
Get name and value of extra field in custom theme was created by Bettina Steffan
Hello,
I created a custom theme, I made a copy of an existing theme and modified it. This works witthout problems.
What I would like to do is to use a specific field of an extra field group.
For example: I use the extra field group construction and i want to show only one field on specific place in my theme.
I have the field Built in and want to show it together with other details.
What is the php code to get the name and value of an extra field in custom template?
Thanks a lot,
Bettina
I created a custom theme, I made a copy of an existing theme and modified it. This works witthout problems.
What I would like to do is to use a specific field of an extra field group.
For example: I use the extra field group construction and i want to show only one field on specific place in my theme.
I have the field Built in and want to show it together with other details.
What is the php code to get the name and value of an extra field in custom template?
Thanks a lot,
Bettina
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
9 years 11 months ago #64298
by Mr. Dam
Replied by Mr. Dam on topic Get name and value of extra field in custom theme
Hi Bettina,
You can modify the theme in file:
components > com_oproperty > templates > theme_name > details.html.tpl.php
This file is property details page.
Thanks
Dam
You can modify the theme in file:
components > com_oproperty > templates > theme_name > details.html.tpl.php
This file is property details page.
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Bettina Steffan
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
9 years 11 months ago #64303
by Bettina Steffan
Replied by Bettina Steffan on topic Get name and value of extra field in custom theme
Thank you Dam, I know which file to edit, but I would like to know the following:
This php code shows all Extra Fields Groups and their Extra Fields:
<?php
if(count($row->extra_field_groups) > 0){
$extra_field_groups = $row->extra_field_groups;
for($i=0;$i<count($extra_field_groups);$i++){
$group = $extra_field_groups[$i];
$group_name = $group->group_name;
$fields = $group->fields;
if(count($fields)> 0){
?>
<h4>
<?php echo $group_name;?>
</h4>
<?php
$k = 0;
for($j=0;$j<count($fields);$j++){
$field = $fields[$j];
$k++;
?>
<div class="span8" style="margin-left:0px;">
<i class="osicon-ok"></i>
<?php
if($field->displaytitle == 1){
?>
<?php
if($field->field_description != ""){
?>
<span class="editlinktip hasTip" title="<?php echo $field->field_label;?>::<?php echo $field->field_description?>">
<?php echo $field->field_label;?>
</span>
<?php
}else{
?>
<?php echo $field->field_label;?>
<?php
}
}
?>
<?php echo $field->value; ?>
</div>
<?php
if($k == 3){
?>
<div class="clearfix"></div>
<?php
$k = 0;
}
}
}
?>
I have the Extra Field Group "Construction" with the extra field "Built In" and I want to get only this field label and value and show it at top position in my template. How can I get a specific extra field value?
Thanks Bettina
This php code shows all Extra Fields Groups and their Extra Fields:
<?php
if(count($row->extra_field_groups) > 0){
$extra_field_groups = $row->extra_field_groups;
for($i=0;$i<count($extra_field_groups);$i++){
$group = $extra_field_groups[$i];
$group_name = $group->group_name;
$fields = $group->fields;
if(count($fields)> 0){
?>
<h4>
<?php echo $group_name;?>
</h4>
<?php
$k = 0;
for($j=0;$j<count($fields);$j++){
$field = $fields[$j];
$k++;
?>
<div class="span8" style="margin-left:0px;">
<i class="osicon-ok"></i>
<?php
if($field->displaytitle == 1){
?>
<?php
if($field->field_description != ""){
?>
<span class="editlinktip hasTip" title="<?php echo $field->field_label;?>::<?php echo $field->field_description?>">
<?php echo $field->field_label;?>
</span>
<?php
}else{
?>
<?php echo $field->field_label;?>
<?php
}
}
?>
<?php echo $field->value; ?>
</div>
<?php
if($k == 3){
?>
<div class="clearfix"></div>
<?php
$k = 0;
}
}
}
?>
I have the Extra Field Group "Construction" with the extra field "Built In" and I want to get only this field label and value and show it at top position in my template. How can I get a specific extra field value?
Thanks Bettina
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.