0

There is any way to override the content page of a particular content type in drupal 7.

By default the content page has the sidebar on the right hand side and the content is placed on the left side

 Page design:

 Content- width 650px | Left sidebar 500px

Here if the content type is company_profile then the width of the content type should be 1050px and the side bar should be below the content page with width 500px as show in the below image

enter image description here

Can anyone help me how to override the content page when the content type is company_profile

3

You can either use hook_preprocess_node() and if the content type is company_profile, change the styling. Or you can have a node--company_profile.tpl.php file and render that particular content type the way you want.

Then you can use CSS to do get things done. If you use a grid based layout such as 960.gs, this would be easier.

2

Have a look at Overriding Page Templates per Content Type in Drupal 7 for a full overview, but basically you need to implement this in your theme's template.php file:

function yourthemename_preprocess_page(&$vars) {
  if (isset($vars['node']->type)) {
    $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
  }
}

Then you'll be able to create content type specific page template files like page--article.tpl.php and page--page.tpl.php...or for your particular case, page--company_profile.tpl.php.

Remember to clear Drupal's cache after you do either of the above, otherwise the theme registry won't be updated with your changes.

0

This you shall do entirely from your theme file (yourtheme.info) by redefining the region names; The rest is css float job and #region-name width setting.

For a particular content-type use this pattern: node--CONTENT-TYPE.tpl.php e.g. node--company_profile.tpl.php

where you copy the node.tpl.php content and edit according to you own wish.

1
  • I need not to change the entire content page.I have to change the content page only for a particular content type say company_profile
    – bharathi
    Apr 9 '12 at 7:00

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.