1

i have created template file for my contenttype wallpaper but i don't know how to get form design in that page.

for example

my content type name is wallpaper, so i create template file for page--node--add--wallpaper.tpl.php in that page how to get title,body etc ..

(ie)node add to page design.

Thanks for advance

1 Answer 1

0

See Drupal 7 Template (Theme Hook) Suggestions

You can do something like page--node--edit.tpl.php or page--node--1.tpl.php

See the available variables in page.tpl.php

Also you can try hook_preprocess_page

<?php
function themeName_preprocess_page(&$vars, $hook) {
  if ((arg(0) == 'node') && (arg(1) == 'add' && arg(2) == 'product')) {
    $vars['template_files'][] =  'page-node-add-type';
  }
}
?>
3
  • Thanks for your replay... But i dont have idea to get design from default contanttype to template file(Wallpaper).
    – elakiya
    Commented Dec 7, 2012 at 7:34
  • @user1881412 You will get the design if you use the exact code of page.tpl.php
    – niksmac
    Commented Dec 7, 2012 at 7:40
  • While am trying to use code of page.tpl.php, am getting below error Fatal error: Cannot redeclare seven_preprocess_page() (previously declared in C:\xampp\htdocs\wall\themes\seven\template.php:32) in C:\xampp\htdocs\wall\themes\seven\page--node--add--wallpaper.tpl.php and I wrote below code <?php function seven_preprocess_page(&$vars, $hook) { if ((arg(0) == 'node') && (arg(1) == 'add' && arg(2) == 'wallpaper')) { $vars['template_files'][] = 'page-node-add-wallpaper'; } } ?>
    – elakiya
    Commented Dec 7, 2012 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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