How to check if a contact has an active membership in a smarty template?
Don't think you have a direct variable to use in the template. Worth trying an extension to provide this? It can be done by simply writing something like below in your hook.

function yourextension_civicrm_postProcess($formName, &amp;$form) {
  if ($formName == "your_form") {

    //Check if user has an active membership of type "General".
    $activeMembership = civicrm_api3('Membership', 'getcount', array(
      'contact_id' =&gt; &lt;contact_id in $form&gt;,
      'active_only' =&gt; 1,
      'membership_type_id' =&gt; "General",
    ));

    //Assign a new variable to the template.
    $form-&gt;assign('activeMembership', $activeMembership);
  }
}


You can now use this variable as {$activeMembership} in the template to check if user has a membership of the req type.