[SOLVED (yipee)] call 1 field in product view - Calguys Products
[SOLVED (yipee)] call 1 field in product view - Calguys Products
Hi.
I'm convinced this is probably really easy, but after a lot of trial and error Im having to admit defeat and ask for help.
The default sample summary for products calls all the custom fields in one lump.
How can I just call for the value of one of them?
I have tried lots of different variations looking at what things i can find with the power of google... but can't actually get it to call the field value individually in my summary at all.
Im using CMSMS 1.5.4 Carolina and Products 2.3.1 if it makes a diff.
I will be eternally grateful if anyone can help. Thanks
I'm convinced this is probably really easy, but after a lot of trial and error Im having to admit defeat and ask for help.
The default sample summary for products calls all the custom fields in one lump.
How can I just call for the value of one of them?
I have tried lots of different variations looking at what things i can find with the power of google... but can't actually get it to call the field value individually in my summary at all.
Im using CMSMS 1.5.4 Carolina and Products 2.3.1 if it makes a diff.
I will be eternally grateful if anyone can help. Thanks
Last edited by jezatron on Thu Aug 27, 2009 9:29 pm, edited 1 time in total.
Re: call 1 field in product view - Calguys Products
well you could go IIRC
That's just one way and I think you may-be able to go directly like {$items->fields->Thename.value} or something like that.. I'd have to look... Hope that helps...
Cheers
Jeremy
Code: Select all
{foreach from=$items item=entry}
{foreach from=$entry->fields key='name' item='field'}
{if $name=='theName'}
{$field->value}
{/if}
{/foreach}
{/foreach}
Cheers
Jeremy
Last edited by JeremyBASS on Thu Aug 27, 2009 6:41 pm, edited 1 time in total.
Re: call 1 field in product view - Calguys Products
calguy1000 informed me it is... $entry->fields.FIELDNAME->value
so that should do it...
Cheers
Jeremy

Cheers
Jeremy
Re: call 1 field in product view - Calguys Products
You need to update to CMSMS 1.6.4. Prior versions are not supported, and in this case pose a potential security risk.jezatron wrote: Im using CMSMS 1.5.4 Carolina and Products 2.3.1 if it makes a diff.
Re: call 1 field in product view - Calguys Products
I'm not sure how to explain the logic but here's an example below:
Assume you create a custom field "SKU" for your products. Display it using the following code (The custom field is case sensitive)
But what if you don't have a SKU for your product... use this
So while I'm here I may as well provide some information on using the custom fiel "Image". We use this to add an image of our Product. The following will display the thumbnail that is generated (you can change the size of the thumbnail in "Calguys Module Extensions"). The image will link to Product Details (detail template)
And in the detail tmeplate, we want to show the thumbnail again but when it's clicked we want the ful size photo to open in a new window
Ad that's it. I'd also recommend that you use the following in your template to see all the $entry variables available to you
I hope this helps
Assume you create a custom field "SKU" for your products. Display it using the following code (The custom field is case sensitive)
Code: Select all
SKU: {$entry->fields.SKU->value}
Code: Select all
{if $entry->fields.SKU->value ne ''}
SKU: {$entry->fields.SKU->value}
{/if}
Code: Select all
{if $entry->fields.Image->thumbnail ne ''}
<a href="{$entry->detail_url}"><img src="{$entry->file_location}/{$entry->fields.Image->thumbnail}" alt="" /></a>
{/if}
Code: Select all
{if $entry->fields.Image->thumbnail ne ''}
<a href="{$entry->file_location}/{$entry->fields.image->value}" target="_blank">
<img src="{$entry->file_location}/{$entry->fields.image->thumbnail}" alt="" />
<div class="zoom">Enlarge this photo</div>
</a>
{/if}
Code: Select all
<pre>{$entry|print_r}</pre>
Re: call 1 field in product view - Calguys Products
Wow Jeremy (/Calguy) and Inyerface. Really appreciate the super-quick response.
Thanks I have searched for this but couldn't find anything and was getting desperate. Ill try implementing this in a second.
Thanks I have searched for this but couldn't find anything and was getting desperate. Ill try implementing this in a second.
Re: call 1 field in product view - Calguys Products
jmcgin51 wrote:You need to update to CMSMS 1.6.4. Prior versions are not supported, and in this case pose a potential security risk.jezatron wrote: Im using CMSMS 1.5.4 Carolina and Products 2.3.1 if it makes a diff.
Oh dear. That's a bit of a worry.
When I first started building this site and finally started making headway I saw they realised a new version of CMSMS but that people were having problems with it. I thought better to crack on on the stable version instead... maybe I was wrong. This is my first CMSMS site.
Is the process of updating from 1.5.4 to 1.6.4 very difficult? I have just pretty much finally got to the end of this site and it feels like it has been going forever! I have learned a lot along the way and feel a lot more comfortable with CMSMS than I did at the start, but obviously there are still some fairly big holes in my knowledge / understanding as I am a designer really.
Thanks again all of you for your advice.
Re: call 1 field in product view - Calguys Products
The upgrade will go fine. I have done the 1.5.4 to 1.6.4 about 15 times now and it went great!!
No problems for me on 1.6 series... just works really well!
No problems for me on 1.6 series... just works really well!
Re: call 1 field in product view - Calguys Products
do you just click 'update cmsms' somewhere or something or do you have to go and do mysql manual backups and stuff? just cos i know nothing lol.inyerface wrote: The upgrade will go fine. I have done the 1.5.4 to 1.6.4 about 15 times now and it went great!!
No problems for me on 1.6 series... just works really well!
Re: call 1 field in product view - Calguys Products
the field call worked by the way thanks
I feel a bit more liberated when it comes to templating now. the next site i will just write the templates for product details and summary from scratch. i did that with the site pages but was different with these as i found it harder to work out.
I feel a bit more liberated when it comes to templating now. the next site i will just write the templates for product details and summary from scratch. i did that with the site pages but was different with these as i found it harder to work out.
Re: [SOLVED (yipee)] call 1 field in product view - Calguys Products
That's great, don't forget to mark [solved] ha you did it as I typed Cheers to youjezatron wrote: the field call worked by the way thanks
I feel a bit more liberated when it comes to templating now. the next site i will just write the templates for product details and summary from scratch. i did that with the site pages but was different with these as i found it harder to work out.

Have a great one today...
Cheers
Jeremy