0

I have a basic page with the URL alias "empezando-ahorrar" and I need to create a node template for it but I can't use the nid. I've made it work when the alias has no hyphen (empezandoahorrar) but I can't make it work with the hyphen.

When the URL alias has no hyphen, using node--empezandoahorrar.tpl.php works perfect. When the alias has the hyphen, using node--empezando-ahorrar.tpl.php doesn't work.

ZenemiG
  • 15
  • 3

3 Answers3

0

Are you using Devel? You can use a dpm() in your code to see if the URL path in the variable is different from what you expect.

0

Seems someone had played with pre-process functions in template.php. You need to check the pre-process functions in template file. There you will get why ???

Read this thread

nitin.k
  • 91
  • 6
0

The template suggestion will be provided in the theme_preprocess_node. Just print the variables in the theme_preprocess_node and check the available template suggestion. You can also provide new suggestion, like this

function theme_preprocess_node(&$variables) {
  $path = current_path();
   if ($path == "empezando-ahorrar") {
     $variables['theme_hook_suggestions'][] = 'node__empezando';
    }
}