Smarty tag not working with Products Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

Smarty tag not working with Products Module

Post by barry cooper »

Hi All, I need to add {Gallery dir='comfort'} smarty tag to a product in CG products module. But its does not work. I have run a {debug} tag from the template but the Gallery tag does not show up. I have increase the PHP memory to 128MB and get no change.
Please goto http://baby.motivatedtraining.co.uk/Pro ... %20blanket to see an example.

Any ideas?

Thanks for your help
Cheers, Barry
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Smarty tag not working with Products Module

Post by jmcgin51 »

In the product description, try replacing
{Gallery dir='comfort'}
with
{capture name='gallery'}{Gallery dir='comfort'}{/capture}{eval var=$gallery}
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

Re: Smarty tag not working with Products Module

Post by barry cooper »

Hi,

Thanks for that, but no joy.

The gallery tag works if its placed in the template. Which is fine but I need to add different gallery dir to products. It look as if the smarty tag is not being read by the product page - is there some thing I can do to the template to correct this?

I have looked at http://forum.cmsmadesimple.org/viewtopic.php?t=18011 but I have little working knowledge of smarty and don't understand.

Thank for your help
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Smarty tag not working with Products Module

Post by jmcgin51 »

When you say that the Gallery tag works if placed in the template, are you talking about the page template or the Products summary/detail template?
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

Re: Smarty tag not working with Products Module

Post by barry cooper »

The tag works when placed onto the product details template.

Thanks for your help, Barry
uniqu3

Re: Smarty tag not working with Products Module

Post by uniqu3 »

Create extra field in Products like "my_dir"
Then in Products template:

Code: Select all

{if !empty($entry->fields.my_dir->value)}
    {Gallery dir=$entry->fields.my_dir->value}
{/if}
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

Re: Smarty tag not working with Products Module

Post by barry cooper »

Thanks for that - I have had a look and am not sure what is supposed to happen.

Any other ideas - cheers

Barry
uniqu3

Re: Smarty tag not working with Products Module

Post by uniqu3 »

In created extra field you enter "comfort" and Gallery should show up if you have the line i posted above in you "Products Template".

Otherwise edit your Products template where it says:

{$entry->details} to {eval var=$entry->details}

Then you are able to add {Gallery} in your WYSIWYG Products area and it will return Module instead of plain text.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Smarty tag not working with Products Module

Post by jmcgin51 »

uniqu3 wrote: Otherwise edit your Products template where it says:

{$entry->details} to {eval var=$entry->details}

Then you are able to add {Gallery} in your WYSIWYG Products area and it will return Module instead of plain text.
Thank you, uniqu3! That's what I was trying to say in my post above, but I'd forgotten the correct syntax...
Post Reply

Return to “Modules/Add-Ons”