Hi,
I am trying to call an individual field in the Availability Module 1.7.1 and cant get it to work. I have used this quite alot in the Products module and have it working fine there and there is also a helpful hint from Calguy in the template stating that "fields are also available by name as $one.fields_byname.". I have been at it for ages and just cant get it to work.
The field I am trying to call is named 'summaryimage' and using this code:
{foreach from=$one.fields_byname.summaryimage item='field'}
{$field.prompt}: {if isset($field.thumbnail)}{else}{$field.value}{/if}
{/foreach}
Does call something, see the random code below, but not my image.
1:
s:
A:
i:
:
c:
t:
Can someone help me out here?
Thanks
Calling An Individual field in the Availability Module 1.7.1 [SOLVED]
Calling An Individual field in the Availability Module 1.7.1 [SOLVED]
Last edited by clj83 on Fri Oct 09, 2009 10:37 am, edited 1 time in total.
Re: Calling An Individual field in the Availability Module 1.7.1
Try doing a {$field|@print_r} to check how the data is arranged.
Re: Calling An Individual field in the Availability Module 1.7.1
Hey,
Thanks for the response, I had done that already but it hadn't really helped that much. However, I have now sorted the problem and for anyone else who wants to know this is the solution:
Calling A Custom Field That Is An Image:
{if isset($rsrcs)}
{foreach from=$rsrcs item='one'}
{foreach from=$one.fields item='field'}
{if $field.name == 'PUT FIELD NAME YOU WISH TO CALL HERE'}
{$field.prompt}: {/if}
{/foreach}
{/foreach}
{/if}
Calling A Text Custom Field:
{if isset($rsrcs)}
{foreach from=$rsrcs item='one'}
{foreach from=$one.fields item='field'}
{if $field.name == 'PUT FIELD NAME YOU WISH TO CALL HERE'}
{$field.prompt}: {$field.value}{/if}
{/foreach}
{/foreach}
{/if}
I hope this helps someone too.
Chris
Thanks for the response, I had done that already but it hadn't really helped that much. However, I have now sorted the problem and for anyone else who wants to know this is the solution:
Calling A Custom Field That Is An Image:
{if isset($rsrcs)}
{foreach from=$rsrcs item='one'}
{foreach from=$one.fields item='field'}
{if $field.name == 'PUT FIELD NAME YOU WISH TO CALL HERE'}
{$field.prompt}: {/if}
{/foreach}
{/foreach}
{/if}
Calling A Text Custom Field:
{if isset($rsrcs)}
{foreach from=$rsrcs item='one'}
{foreach from=$one.fields item='field'}
{if $field.name == 'PUT FIELD NAME YOU WISH TO CALL HERE'}
{$field.prompt}: {$field.value}{/if}
{/foreach}
{/foreach}
{/if}
I hope this helps someone too.
Chris
Re: Calling An Individual field in the Availability Module 1.7.1 [SOLVED]
just to keep it up to date. you solution seems to be a lil bit complicated.
try this one for summary template:
and this one for detail template of resource:
try this one for summary template:
and this one for detail template of resource:
Last edited by nicmare on Tue Aug 03, 2010 11:42 am, edited 1 time in total.
Re: Calling An Individual field in the Availability Module 1
I go with
$rsrc.fields.YOUR_FIELD.value
$rsrc.fields.YOUR_FIELD.value
Re: Calling An Individual field in the Availability Module 1
I believe that this is a more complete Answer:
For the "Summary template" Use:
For Field Array:
{$one.fields.YOUR_FIELD}
For Field Value:
{$one.fields.YOUR_FIELD.value}
For the "Detail template" Use:
For Field Array:
{$rsrc.fields.YOUR_FIELD}
For Field Value:
{$rsrc.fields.YOUR_FIELD.value}
Works 100%
Regards.
For the "Summary template" Use:
For Field Array:
{$one.fields.YOUR_FIELD}
For Field Value:
{$one.fields.YOUR_FIELD.value}
For the "Detail template" Use:
For Field Array:
{$rsrc.fields.YOUR_FIELD}
For Field Value:
{$rsrc.fields.YOUR_FIELD.value}
Works 100%
Regards.