OS Property support center

support : pulling a custom field code

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15936 by sti
We are preparing to design the listing and detail template.

we want to include some custom fields as well.

please let us know how to pull the custom fields into the template.

Thanks

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

More
11 years 11 months ago #15937 by Mr. Dam
Replied by Mr. Dam on topic Re: support : pulling a custom field code
You can use the funtion
HelperOspropertyFields::showField($field,$pid);
$field : the custom field object. $field->id is the id of the custom field
$pid is the property id.
Thanks
Ossolution

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

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15938 by sti
Thanks

but , how do we use this ?

as in below?

<? php echo HelperOspropertyFields::showField($field,$pid); ?>

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

More
11 years 11 months ago #15939 by Mr. Dam
Replied by Mr. Dam on topic Re: support : pulling a custom field code
No, you don't need to use echo.

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

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15940 by sti
ok.

where is the custom field object in the database?

is it the sample is textarea, select ,etc?

thanks

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

More
11 years 11 months ago #15941 by Mr. Dam
Replied by Mr. Dam on topic Re: support : pulling a custom field code
As you can see, the custom fields can be textbox, textarea, radio buttons, checkboxes v.v.
When you create new custom fields in the backend, you can select the custom field types. After creating the custom fields, they will be shown in the frontend with the type you already selected.
Thanks
Ossolution

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

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15942 by sti
damdt wrote:

As you can see, the custom fields can be textbox, textarea, radio buttons, checkboxes v.v.
When you create new custom fields in the backend, you can select the custom field types. After creating the custom fields, they will be shown in the frontend with the type you already selected.
Thanks
Ossolution


Hi. yes, this basic and we understand, however the question was not this..

thanks

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

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15943 by sti
in the database, the structure is as below

id
group_id
field_type
field_name
field_label
field_description
ordering
required
show_description
options

so,

$field : the custom field object.

is this field_type?

thanks

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

  • sti
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 years 11 months ago #15944 by sti
HelperOspropertyFields::showField($field,$pid);

sample is

<?php HelperOspropertyFields::showField(textarea,119);

it doesnt load the template.

thanks

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

More
11 years 11 months ago #15945 by Mr. Dam
Replied by Mr. Dam on topic Re: support : pulling a custom field code
Yes, you are correct. Notice it is the integer field.

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

Moderators: Mr. DamNguyen Phu Quan