Jump to content
cedib

Conditional statement on module custom hook in 1.7.6.1

Recommended Posts

Hi,

From a module I have extra fields in categories in 1.7.6.1, such as a custom title. The module gives me then the widget code to add in the tpl:

{widget name='customfieldsmodule' hook='cat_custom_h1'}

What conditional statement can I put to check if the field is empty or not?

I've tried this but it doesn't work:

{assign var='displayCatCustomH1' value={widget name='customfieldsmodule' hook='cat_custom_h1'} }

{if $displayCatCustomH1}{if $displayCatCustomH1}{/if}

Has anyone any idea?

Thanks

Share this post


Link to post
Share on other sites

Does it happen to others that Prestashop seem to add some comments in the front-end rendering code of the widget?

<!-- begin module:mymodule/views/templates/hook/customHook.tpl —>
<!-- begin /home/vdfvfhdr/public_html/mysite/modules/mymodule/views/templates/hook/customHook.tpl —>
<div>Content of my custom field</div>
<!-- end /home/vdfvfhdr/public_html/mysite/modules/mymodule/views/templates/hook/customHook.tpl —>
<!-- end module:mymodule/views/templates/hook/customHook.tpl —>

Is there a way to get rid of this? I think that's why my condition is not working.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More