Saturday , 21 December 2024
Breaking News

How to Customize a Drupal Page

how to customize drupal seekdotnet

The Drupal cms can be one good option when you want to build a website. Drupal has many possibilities that web designers can use to represent the content exactly as they want. The best way to use Drupal is by using the template naming convention to your advantage. That way you can gain control of a specific page you have already created and work with the page at HTML and CSS level. Such as, you may have an About Us page which you have created but you want this page to look different in style and layout that your other pages. You can customize it as follows:

1. Assume this page is called “About Us” with a URL of www.<you site name>/aboutus. Note: you can replace the name for any other which you may want to customize.

2. Open up your usual HTML editor program. Try Dreamweaver for instance. If you don’t have Dreamweaver of an HTML editor, there are a number of free HTML editor applications available on the web and a search through Google or a visit to download.com you should be able to find one to suit.

3. With your HTML editor at the ready, select open from the menu and navigate to your theme folder. Here you should find the page.tpl.php file. This file provides all the default coding for your Drupal theme pages and will be the template which your Drupal installation will select unless it finds a more specific template to use instead. This is the purpose of the exercise. We want to provide an alternative .tpl.php template for our specific page, which will override the default page.tpl.php template.

4. Open the page.tpl.php file.

5. Rename the file using the following naming convention

page-aboutus.tpl.php

Notice two things here. First, the hyphen which is placed between the word page and the URL name of your page. Secondly the second part of the name is the URL name of your page followed by the .tpl.php file extension. In our example we have used “aboutus”, but you can put here whatever you require.

6. This new file that you have created will now override the default page template. So feel free to work with the HTML and CSS in order to customize your Drupal page.

7. When done, upload the new customized page template into your theme folder.

  • You may need to also clear your cache using the main core Performance page. Navigate to Site Configuration > Performance (/admin/settings/performance)
  • The main core Performance page will load – on this page you’ll find configuration settings for page caching; page compression; block caching; and for optimizing CSS and Javascript files.

8. Now go to your website and to the page which uses your new custom Drupal page template. You should now be able to see the differences you made when editing this file separately. If you need to make more changes simply return to your HTML editor and customize further.

Build your website with Drupal cms from Seekdotnet.com today and don’t hesitate to ask our experts to set your Drupal website to its best.

Check Also

How to Hide Certain Pages on Drupal System

Sometimes, there are some pages which are not necessary and even inappropriate to be detected …

[email protected]