• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Calling An Individual field in the Availability Module 1.7.1 [SOLVED]
PostPosted: Thu Oct 08, 2009 8:59 pm 
Offline
Forum Members
Forum Members

Joined: Tue Jul 07, 2009 4:09 pm
Posts: 185
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.

Top
 Profile  
 
 Post subject: Re: Calling An Individual field in the Availability Module 1.7.1
PostPosted: Thu Oct 08, 2009 10:35 pm 
Offline
Power Poster
Power Poster

Joined: Mon Jan 21, 2008 5:51 pm
Posts: 701
Location: MI
Try doing a {$field|@print_r} to check how the data is arranged.

_________________
Arvixe Hosting / CMSMS Community Liaison
Looking for quality CMSMS Hosting? Try Arvixe


Top
 Profile  
 
 Post subject: Re: Calling An Individual field in the Availability Module 1.7.1
PostPosted: Fri Oct 09, 2009 10:36 am 
Offline
Forum Members
Forum Members

Joined: Tue Jul 07, 2009 4:09 pm
Posts: 185
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


Top
 Profile  
 
 Post subject: Re: Calling An Individual field in the Availability Module 1.7.1 [SOLVED]
PostPosted: Tue Aug 03, 2010 10:35 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Sat Aug 25, 2007 9:55 am
Posts: 1186
Location: Berlin
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:

_________________
follow me on twitter
---
find great code snippets at i-do-this blog
---
powerful templates for cms made simple


Last edited by nicmare on Tue Aug 03, 2010 11:42 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Calling An Individual field in the Availability Module 1
PostPosted: Fri Sep 23, 2011 8:44 pm 
Offline
Forum Members
Forum Members

Joined: Wed Mar 18, 2009 5:59 pm
Posts: 30
I go with

$rsrc.fields.YOUR_FIELD.value


Top
 Profile  
 
 Post subject: Re: Calling An Individual field in the Availability Module 1
PostPosted: Mon Apr 30, 2012 12:38 am 
Offline
Forum Members
Forum Members

Joined: Thu Apr 26, 2012 9:36 am
Posts: 12
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner