S
S
Sergey Nozdrin2013-04-12 13:57:35
Drupal
Sergey Nozdrin, 2013-04-12 13:57:35

How to change the template for a specific Drupal 7 page?

Hello comrades!

I'm still getting to grips with Drupal 7. Now I have a question that was asked in the Topic Title. I realized that if you put the file page--front.tpl.php next to page.tpl.php (which sets the main canvas for displaying all pages of the site) , then you can cover the main page with a completely different design. But how do you make sure that you can apply a different design to 1 of the regular pages on your site that have links like www.example.com/node/3 ? Thank you for your help on my path to enlightenment)


Answer the question

In order to leave comments, you need to log in

5 answer(s)
Z
Ziklon, 2013-04-12
@light204

Theming of a specific page
Go to the template folder (your_site/sites/all/themes/your_template/tempalates).
Copy the page.tpl.php file to page--node_number/page_address.tpl.php.
We edit the created file for our needs.
Clearing the cache on the site.

A
Aisu_Kuge, 2013-04-12
@Aisu_Kuge

How much does the design need to change? If this can be done with CSS, then the code is simpler

A
Aisu_Kuge, 2013-04-12
@Aisu_Kuge

There is also a Panels module , but this is for creating a node with a special blocking.
З.ы I apologize for 2 posts, when I tried to save edits, I got the answer: “You cannot edit this material” =(

S
smil1k, 2013-04-12
@smil1k

Information on redefining pages can be found here drupal.org/node/1089656
Here, if you need to redefine the theme for the page www.example.com/node/3 , create a file in the theme folder page--node--3.tpl.php.
Drupal tutorials can be found here:
buildamomodule.com/
www.lullabot.com/
drupalize.me/
www.lynda.com/search?q=drupal&x=-1371&y=-42

N
Nilard, 2013-04-20
@Nilard

How did you hear about page--front.tpl.php ? There is also about the rest - in the documentation Drupal 7 Template (Theme Hook) Suggestions http://drupal.org/node/1089656#page-suggestion : page--[front|internal/path].tpl.php
...

  1. page--node--edit.tpl.php
  2. page--node--1.tpl.php
  3. page--node.tpl.php
  4. page.tpl.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question