THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


How to check in smarty template "if module exists". I've created module with form. When module is not activated i've received error that this form is not exists and I have to manually comment this block of code.

  • manu
  • faï tot petar miladiu

Offline


You can wrap your form in a module loop :

{loop type="module" name="myform_test" code="your_module_code"}
   {form name="..."}
    ...
   {/form}

{/loop}

You can use code parameter or id parameter, both are unique identifier but the code never change (you can retrieve this code in the module table).


http://doc.thelia.net/
http://thelia.net/modules
http://raynaud.io
PGP public Key : 0xC6E546A6

  • manu
  • faï tot petar miladiu

Offline


and obviously use the active parameter in the loop :-)

{loop type="module" name="myform_test" code="your_module_code" active="1"}
   {form name="..."}
    ...
   {/form}

{/loop}

http://doc.thelia.net/
http://thelia.net/modules
http://raynaud.io
PGP public Key : 0xC6E546A6

Offline


thanks ... it helps