Calling An Individual field in the Availability Module 1.7.1 [SOLVED]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
clj83
Forum Members
Forum Members
Posts: 195
Joined: Tue Jul 07, 2009 4:09 pm

Calling An Individual field in the Availability Module 1.7.1 [SOLVED]

Post by clj83 »

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
Last edited by clj83 on Fri Oct 09, 2009 10:37 am, edited 1 time in total.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Calling An Individual field in the Availability Module 1.7.1

Post by Jeff »

Try doing a {$field|@print_r} to check how the data is arranged.
clj83
Forum Members
Forum Members
Posts: 195
Joined: Tue Jul 07, 2009 4:09 pm

Re: Calling An Individual field in the Availability Module 1.7.1

Post by clj83 »

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
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

Re: Calling An Individual field in the Availability Module 1.7.1 [SOLVED]

Post by nicmare »

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:
Last edited by nicmare on Tue Aug 03, 2010 11:42 am, edited 1 time in total.
bunker
Forum Members
Forum Members
Posts: 30
Joined: Wed Mar 18, 2009 5:59 pm

Re: Calling An Individual field in the Availability Module 1

Post by bunker »

I go with

$rsrc.fields.YOUR_FIELD.value
yumein
Forum Members
Forum Members
Posts: 12
Joined: Thu Apr 26, 2012 9:36 am

Re: Calling An Individual field in the Availability Module 1

Post by yumein »

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.
Post Reply

Return to “Modules/Add-Ons”