Page 1 of 1

hide content blocks in NMS [SOLVED]

Posted: Mon Dec 03, 2012 10:46 am
by crosmuller
Hi,

I created a message template in NMS with several html content blocks, the content blocks appear in the newsletter as divs with a background color. So far so good. But how can I hide the content blocks that are empty? I don't know how many blocks the user needs, this is different for every newsletter.

I use NMS 2.7

thanks

Re: hide content blocks in NMS

Posted: Mon Dec 03, 2012 11:51 am
by uniqu3
You need to assign these to a variable first.

Code: Select all

{tag_for_nms_block assign='myvar'}
If NMS doesn't use assign parameter you can capture that block

Code: Select all

{capture assign='myvar'}{tag_for_nms_block}{/capture}
then in template you check against that variable if it has some value

Code: Select all

{if !empty($myvar)}
<!-- the template stuff -->
  {$myvar} <!-- << this would return content of assigned nms block !-->
<!-- the template stuff -->
{/if}

Re: hide content blocks in NMS

Posted: Mon Dec 03, 2012 12:02 pm
by crosmuller
Great thanks!

Where do I put the first (or second) block of code?

Re: hide content blocks in NMS

Posted: Mon Dec 03, 2012 12:10 pm
by uniqu3
In NMS message template??

Re: hide content blocks in NMS

Posted: Tue Dec 04, 2012 11:56 am
by crosmuller
Thanks, it works