How do I use the API to check MembershipType and "active" status?
I assuming you're doing this with a .tpl.extra file. I tried mocking this up in the API Explorer and found a couple shortcomings, namely the lack of support for arrays in smarty, and the inability to set a contact ID field to the magic "user_contact_id" value. Here's a fix for both those issues.

The upshot is you can now do this:



Instead of the boilerplate {foreach} loop you can do a simpler conditional. Here's the full code you would use:

{php}
  $this-&gt;assign("param_status_id", array('IN' =&gt; array("New", "Current", "Grace")));
{/php}
{crmAPI var='result' entity='Membership' action='get' contact_id="user_contact_id" membership_type_id=1 status_id=$param_status_id return="id"}
{if !empty($result.values)}
  Blah blah blah...
{/foreach}