Hi,

I'm fairly new to Drupa programming and its concepts.

My website is using the bluemasters theme, and I wanted to customise another page as it is the case with the frontpage.

The bluemasters template.php contains only the following two lines:

if (drupal_is_front_page()) {
drupal_add_js(drupal_get_path('theme', 'bluemasters') . '/js/bluemasters.js');
}

I googled a bit and found this interesting example:
http://highrockmedia.com/blog/customizing-user-login-page-drupal-7

function your_themename_theme() {
  $items = array();
  // create custom user-login.tpl.php
  $items['user_login'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'your_themename') . '/templates',
  'template' => 'user-login',
  'preprocess functions' => array(
  'your_themename_preprocess_user_login'
  ),
);
return $items;
}

I applied it to my website and it worked for mywebsite.com/user/login

But when I wanted to apply it to the actual page that is called mywebsite.com/many-lessons , I realised that I can't make it work.

I did like this:

in the template.php I added the function:

function bluemasters_theme() {
  $items = array();
  // create custom user-login.tpl.php
  $items['many_lessons'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'bluemasters'),
  'template' => 'many-lessons',
  'preprocess functions' => array('bluemasters_preprocess_many_lessons'),
);
return $items;

and then I created the file many-lessons.tpl.php

But the content of the file many-lessons.tpl.php never gets triggered. The content is a simple dump of variable to see if it reaches that point:

<?php
 
/* print the variables if needed to allow for
  individual field theming or breaking them up. */
 
print '<pre>';
 
print_r($variables);
  print
'</pre>';
?>

I played in the template.php and I changed instead of 'many_lessons' I edited to 'many__lessons' since I've read that there is an issue with the hypens... but on the other hand my many-lessons page is an alias.

On top of this my pages are translated so I have mysite.com/many-lessons but also mysite.com/fr/beaucoup-lessons

I cleared the cache many times.

I have a feeling that in the bluemasters theme some shortcuts were taken(or maybe I'm wrong).

How shall I best approach it?
I must admit that at this stage I'm still a bit confused between template and theme, I believe since template.php must be used as well for modules and if I search on google I get mixed results...

Many thanks in advance

Comments

Maybe I can rephrase my

Maybe I can rephrase my question.

Generally speaking, how can I customize another page like the front page is customised?

The easiest would be just to load some extra CSS for that particular page and then add the HTML tags in the content of the page.

The most complex would be to start writting php code, I guess that it needs to go in the template.php of the theme and implement it with hooks, like I tried above.

Is the above correct? or are there any other ways?

Thanks

You still use custom tpl's.

You still use custom tpl's. Here is the documentation. http://drupal.org/node/1089656

Thank you DonCoryon, I

Thank you DonCoryon,

I managed to solve it by using the page--node--1.tpl.php
I added some blocks in the theme and in the page--node--1.tpl.php I only do a print of these blocks.

but now I'm faced with the issue of translating this page.

I have another page, node 5 that is the french translation of node 1.
The blocks I can translate, but when I change from english to french, I get the initial node/5, and not the node-1 with the translated blocks.

I guess it makes sense the above behaviour.

the solution would be to copy paste the content of the page--node--1.tpl.php to page--node--5.tpl.php.
Is there any other solution? or a better way?

I use aliases with pathauto for each path, but I think that I still have to work with the actual node numbers rather than the aliases.

Thank you

Your very welcome. If I'm

Your very welcome.

If I'm understanding correctly you have two nodes {English and French} and two sets of blocks {same}. Inside the block edit form you are able to set what pages that the block will display for. So set the English blocks to only display for node/1 and the French blocks to only display for node/5.