How to theme a node form from my custom module? I have a node type with machine name "resource", and I'm trying to theme it in my module "modulename". 

I've tried doing this:

function modulename_theme() {
  return array(
    'resource_node_form' =&gt; array(
      'render element' =&gt; 'form',
      // 'template' =&gt; 'resource-node-form',
      // 'path' =&gt; drupal_get_path('module', 'modulename'),
    ),
  );
}

//I've tried both functions, getting nothing

function theme_resource_node_form($variables) {
  dsm($variables);
  return 'Testing';
}

function modulename_resource_node_form($variables) {
  dsm($variables);
  return 'Testing';
}


I've cleared cache, nothing happens. I've also tried with templating approach:

function modulename_theme() {
  return array(
    'resource_node_form' =&gt; array(
      //'render element' =&gt; 'form',
       'template' =&gt; 'resource-node-form',
       'path' =&gt; drupal_get_path('module', 'modulename'),
    ),
  );
}


And placing resource-node-form.tpl.php in modulename module folder. Cleared cache, nothing happens.

Sure I'm doing something wrong, but I can't figure it out. I've used templates for existing forms from a custom theme, but I'd like to do it this way, this time. Better approach for this project I'm working on, I think.

Thanks for your answers, ask me if you need more info!
Use this:

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  switch ($form_id) {
    // Expected format: NODE_TYPE_MACHINE_NAME_node_form
    case 'resource_node_form':
      // Requires devel module to be installed.
      // See all available elements displayed using krumo.
      $dpm($form);
      break;
  }

}


Update:

Depending on the complexity of your layout, check Display Suite and Field Group modules, as their functionality might be what you need.

You can also follow up this article if you want to do this from a tpl file. The approach is similar to what you were trying to do.