Is it possible to have forward--CONTENTTYPE.tpl.php. I tried it and it didn't work.

I want to have different templates per node type.

Comments

john.oltman’s picture

Category: support » feature

That would be a nice feature and I'll add to the list. For now, you would have to place IF statements in the single template file, that do different things depending on what the value of $content->type is. If you are forwarding a node, $content points to a node object when you are within forward.tpl.php. I haven't tried this myself, so let me know if you run into trouble.

john.oltman’s picture

Issue summary: View changes

Bump

john.oltman’s picture

john.oltman’s picture

Category: Feature request » Support request
Status: Active » Closed (works as designed)

In Drupal 7 you should be able to add a mytheme_preprocess_forward function to your template.php file.
https://api.drupal.org/api/drupal/modules!system!theme.api.php/function/...

In Drupal 8 you should be able to add a mytheme_theme_suggestions_forward_alter function to your mytheme.theme file.
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...