All popular questions related to OS Property will be posted here

How to show each extra field in one line

  • Mr. Dam
  • Topic Author
  • Offline
  • Administrator
  • Administrator
More
9 years 8 months ago #48622 by Mr. Dam
Hi,
Some customers asked us that they want to show each extra field in one line in Property details page (Like attachment). Good news is you are able to do it by modifying the Details layout of your current using theme.
Please open file
components > com_osproperty > templates > your_current_template > details.html.tpl.php
find this
Code:
<?php $k = 0; for($j=0;$j<count($fields);$j++){ $field = $fields[$j]; $k++; ?> <div class="span4" style="margin-left:0px;"> <i class="osicon-ok"></i>&nbsp; <?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 } } ?> :&nbsp;<?php echo $field->value;?> </div> <?php if($k == 3){ ?> <div class="clearfix"></div> <?php $k = 0; } } } ?>

Above code to show 3 extra fields in one line. You can use bellow code to show 2 extra fields in one line
Code:
<?php $k = 0; for($j=0;$j<count($fields);$j++){ $field = $fields[$j]; $k++; ?> <div class="span6" style="margin-left:0px;"> <i class="osicon-ok"></i>&nbsp; <?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 } } ?> :&nbsp;<?php echo $field->value;?> </div> <?php if($k == 2){ ?> <div class="clearfix"></div> <?php $k = 0; } } } ?>

You can use bellow code to show 1 extra field in one line
Code:
<?php $k = 0; for($j=0;$j<count($fields);$j++){ $field = $fields[$j]; $k++; ?> <div class="span12" style="margin-left:0px;"> <i class="osicon-ok"></i>&nbsp; <?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 } } ?> :&nbsp;<?php echo $field->value;?> </div> <div class="clearfix"></div> ?> } } ?>

Good luck
Ossolution team
Attachments:
The following user(s) said Thank You: Philipp, Szabó Zsolt

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

More
9 years 3 weeks ago #60643 by Szabó Zsolt
Replied by Szabó Zsolt on topic How to show each extra field in one line
Hi Dam,

Can you help me which one is my_current_template? I use OSPholiday.

I found this directories
blue default theme1 theme2 theme3 theme_black
at components > com_osproperty > templates >


Thanks,
Zsolt
Attachments:

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

More
9 years 3 weeks ago #60656 by Szabó Zsolt
Replied by Szabó Zsolt on topic How to show each extra field in one line
Hi,

Thanks, we found it the directory Blue.

Zsolt

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

More
8 years 9 months ago #65090 by Rovshan
Replied by Rovshan on topic How to show each extra field in one line
hello.could you change for me this file.i want extra fields with 1 line.
i cant find with notepad replaced files
if possible atach this file
details.html.tpl.php

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

Moderators: Mr. DamNguyen Phu Quan