1
if ($variables['node']->type == 'netrunner_card' && $variables['view_mode'] == 'full') 
{
    $blinksFileName = $variables['node']->field_card_type['und'][0]['taxonomy_term']->name;
    $blinksFileName = str_replace( " ", "_", $blinksFileName);
    $blinksTemplateName = 'node__netrunner_card__' . $blinksFileName . '__full';
    $variables['theme_hook_suggestions'][] = $blinksTemplateName;
}

I can't get the tpl to load! Ive got two tpl files currently for two types of cards.

'node--netrunner-card--Runner-Identity-Card--full.php' 'node--netrunner-card--Operation--full.php'

and I even tried: 'node--netrunner-card--Runner_Identity_Card--full.php'

Nothing. I'm so confused at this point I don't know where else to go... Any help would be appreciated.

  • Please confirm your exact filenames for us. – mpdonadio May 14 '13 at 18:06
  • 1
    quick issue is they should be foobarbazbing.**tpl**.php, eg, node--somethingorother.tpl.php not node--somethingorother.php – Jimajamma May 14 '13 at 18:12
  • 1
    I am so ashamed... rookie move. Luckily, I'm still a Drupal rookie... thanks. tpl added, files working... D'oh! – randomblink May 14 '13 at 18:49
0

The solution was to rename my template files so that the extension was tpl.php instead of just .php. Once I renamed the files to add the tpl the files started working instantly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.