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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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