Drupal 7: Display the number of search results in page.tpl.php
During many occasions, i have wanted to show the total number of results (and the values of the pager) in page.tpl.php and not at the default location of the search template.
Actually it is quite simple, you just need to override the function theme_preprocess_page(&$vars) in your template.php file of your theme.
Then, in the page.tpl.php, just use the set variables:
Notice: THEMENAME is to be replaced by your custom theme name.
Drupal 7: Changing the default front page content
There are many ways that one can change the default front page content of a fresh Drupal installation. Below you will find the most common:
1. Remove the "No front page content has been created yet." message (Quick and dirty method)
To remove the default Front page message of a fresh Drupal installation and have just a blank page, just add this code to your template.php file of your theme. THEMENAME is to be replaced by the name of your theme!
2. Set a custom page as the front page
Another way to change the contents of the front page is to assign a custom page to it. To do that go to Configuration > Site information > Default front page and enter the URL of your custom front page.
3. Set a view as the front page content
Using the same method as above, after creating a page view that will display the required content, just enter the page view URL to Configuration > Site information > Default front page.
4. External modules
If none of the above methods is convenient, then there are a couple of modules that will do the job:
No comments:
Post a Comment