So I have been working on a Drupal 7 website and decided that I wanted to build one from scratch without the use of a template to meet the need that I have. I have done a bit of HTML coding but PHP is a new game all together for me. It has been a learning experience that I have benefited from.
I wanted to show other on how to configure a Drupal 7 website with mainly CSS and a little bit of PHP to format the site like you need to. I will break this up into multiple parts so that it is easier to read and follow along with.
For this tutorial the site needs to be placed into the "F:\wamp\www\drupal\themes" of your web server. I am using WAMP in this case but you could use Acquia, XAMMP, or whatever else you are comfortable with.
The .info file is what tells Drupal that you are using a custom theme and what features the theme will have. You will notice that the name is the same as the info file. This naming needs to match what you named the folder for your site. In this case I named my site basesite.
You do not have to put a version but I did for fun, but you do have to put the core version. If you are making a site for previous releases of Drupal then this needs to go into the core line.
The Stylesheets line lets you specify what pages the style sheet can affect and what folder location the style sheet is located in. I just put mine in the same directory since this is going to be a test site for these blog post.
Regions are the areas where your features such as a header, search, login, main content, features or anything else will be places. From what I understand if you do not specify these options then it will default to the Drupal core defaults.
basesite.info
The page.tpl.php file is kind of like your general HTML file with all of your markup, but instead of adding your general text, pictures, and content you will place the php required for Drupal to manage your content and images as specified in your configuration.
The only PHP that i have in this page is the content, sidebar_first, and the footer. As noted in our info file we can add more regions but I wanted to keep this simple.
page.tpl.php
I know the CSS file is blank but I am wanting to display a simplified version of some of the fantastic Drupal sites that we have seen out there. We will add more to this file later on in later blog post.
CSS file
After you save these files to your themes folder and name them accordingly you should get the following version of a simplified site.
This base template is a great template for one to start out with to play with different techniques prior to adding the content required for a fully functional site.
I had previous content from another site that I was working on and this is just test content from Microsoft about user accounts in Server 2008 R2.
Another thing that should be noted is that there is the options to "Demonstrate block region" to validate your regions are setup the way that they should be. You can access this in the admin menu under Structure and then click on blocks. You will notice that in the above screen shot I have no Footer, this is due to me not setting a footer for this page. It shows us the layout between the page.tpl.php and css files. Its a useful tool if you are having issues placing your regions.
3 comments:
This information is very helpful. Keep posting.
Drupal
The post is very nicely written and it contains many useful facts. I am happy to find your distinguished way of writing the post. Thanks for sharing your post.
website design
Thanks for sharing information...
Post a Comment