Ways to customize the Drupal home page
This article illustrates how to customize the Drupal front page. Share with you for your reference. The specific implementation method is as follows:
Drupal's default home page looks like a list of blog posts. How do you customize it to look the way you want? There are several ways to do this:
Use Front Page module When most people realize a function, the first thing they think of is to use modules (Front Page home page module), but they do not agree with the use of modules at every turn, too many modules increase the system burden, the following method also solves the problem of customizing the home page without using modules.
Use page-front.tpl.php page template page-front.tpl.php is the page template of the home page, copy page.tpl.php and change the name to page-front.
Using node-front.tpl.php node templates If you only want to change the style of the nodes displayed on the home page, you can only change the template at the node level. Copy node.tpl.php and rename it node-front_page.tpl.php, changing the display style of the nodes in it.
Create a new page page using a page page as the home page, add the html code, and select full html, remembering the ID number. Navigate to admin/settings/site-information, in the bottom "Default front page" input box, now the default is node, we change it to node/1 (note 1 is changed to the ID number of the page set as the home page).
Use block blocks to define the display properties of blocks one by one in admin/build/block, fill in
The biggest feature of the $mission variable is that it can only be displayed on the home page. Using this feature, we can easily customize the home page. Define the mission task in admin/settings/ site-information (put the home page code in it), then edit the page.tpl.php file and move $mission to the desired location. If this variable is not in the file, add the following code:
<div id="missions">
<? php print $mission; ? >
</div>
<? php endif; ? >
The above methods can be used alone or in combination as needed. Another option is to use the index.html static page directly, but this is out of drupal and therefore not recommended.
I hope this article will help you with your drupal site.
Related article
-
Drupal CMS can produce 16 types of websites
I don't know. Drupal is amazing. Many people who use CMS content management systems will probably know about a foreign CMS system: Drupal. In our traditional imagination, CMS can do not only content article stations, but also picture stations2010-01-24 -
Drupal enables caching and Gzip compression setup methods
Enable caching and Gzip compression transfer for pages and static resources.2010-01-24 -
drupal module development analysis
drupal module development analysis, easy to want to drupal module development friends2012-12-06 -
The drupal custom form calls the autocomplete main tag implementation code
drupal custom form call autocomplete main tag implementation code, need friends can refer to the next2012-12-06 -
drupal transforms the order of Date form elements month day year to month month day
This article mainly introduces the method of transforming the Date form elements in the order of month day year to month day, which is a problem that many drupal users will encounter when they conduct secondary development. The friends who need it can refer to it2014-11-04 -
drupal implements methods for adding content under comments on node nodes
This article mainly introduces the drupal implementation in the node node comments below the method of adding content, involving the modification of related functions and the use of hook functions, has a certain reference value, need friends can refer to2014-11-04 -
drupal import image implementation method
This article mainly introduces the implementation method of drupal import pictures, which is a very practical skill, and the friends who need it can refer to it2014-11-03 -
drupal import data implementation method
This article mainly introduces the implementation method of drupal import data, which is very practical value, and the friends who need it can refer to it2014-11-03 -
drupal creates a drag-and-sort table method
This article mainly introduces the method of drupal to create a drag sort table, including the specific steps and implementation code, has a certain reference value, the need of friends can refer to2014-11-03 -
drupal implements methods that output clickable table headers to sort tables
This article mainly introduces the method of drupal to achieve the output of clickable table header sorting table, including the definition of the table, SQL statements, table content and the generation of HTML files, etc., need friends can refer to the next2014-11-03
Latest comments