General Settings

This page contains a mixed bag of settings, some of which are pretty self explanatory while others will require us to think quite carefully about what we need to do. To start with, we are presented with a few text boxes that control things like the name of the site, the mission statement, and so on. For the demo site, the following settings were entered for the first six options:

General Settings

On the face of it, we are pretty much set here. There isn't anything complex about these settings, and it should be fine to move on with the next lot; or should we check first? It is important to remember that before we continue it is always wise to use the site to ensure whatever modifications have been made have the desired effect.

After saving the aforementioned changes, the demo site now looks like this:

General Settings

Hmm, this is not ideal! For a start, we seem to be missing our slogan entirely, and the hard hitting poetry we added in the Footer message section isn't being displayed in the format we want it either. What's going on? As you can see, things are not always as straightforward as they seem. The reason the slogan is not displayed is because some themes don't display a slogan at all (or simply have the slogan disabled by default), and the reason that the footer has not come out in poetry format is because we haven't told Drupal to format it as such.

Oh dear, it looks like we have already run into problems that, with the information we have at hand, cannot be easily solved. The answer here is to be patient and wait until we have dealt with various other configuration settings and themes in some detail as this will help us to understand how we can modify the actual presentation of the site with a greater level of sophistication.

That's not to say we are entirely without tricks up our sleeve. Bear in mind that Drupal will format HTML (HyperText Markup Language) if you enter it into the text boxes. So, if instead of the original Footer message text, we entered something like this:

<p align="center"><i>
So tell your children fairy tales,<br />
as the tears fall on the page,<br />
when we killed what made us human,<br />
to embrace an empty age.
</i></p>

The footer message would then appear on the site as follows:

General Settings

This is far more suitable for our purposes since the text is both poetry, and a quote (hence the italics) from a poem called The Vanishing.

For some of you, this may present a bit of a problem because you are unfamiliar with HTML. If at this stage you have little to no knowledge of HTML, then you might find it worthwhile teaching yourself a little bit about it before you continue on—if so, jump ahead to the section on HTML, PHP, and Content Posting in Chapter 7, for more information on this.

Moving along we see that we also have the option of defining a name for anonymous users. This is fine as it is, but feel free to change this if you have a compelling reason for doing so. The only thing this will do is change the credited name of a posting from Anonymous to whatever you have set (assuming you allow anonymous users to post any content to the site). Let's take a look at the remaining settings in this section before going into an explanation of them:

General Settings

As you can see, we have changed the Default front page to node/2. But what does changing this setting do? Well, let's assume that there is a page of content that you would like to be displayed as the default page of your website—before anyone views any of the other content. For example, if you wanted to display some sort of promotional information or an introduction page, you could tell Drupal to display that using this setting. In this case, the second node has been stipulated as the default front page—remember that you have to create the content for this post first, and then determine its ID before you can tell Drupal to use it.

It is probably best that you leave this as is for the moment, until we have discussed how to add content. If you are keen on getting something posted to the site, simply use the create content link at the top of the menu and follow the instructions there. You should be able to get something up and running fairly easily. The important thing about content as it relates to this section, however, is that you need to know the ID of the node you want to specify as the default front page.

This is easy if you bear the following in mind:

Note

Whenever you edit content, the ID of the node being edited will appear in the URL.

We are not finished yet, because it is possible to specify several options depending on what you require for your front page. In this case, the specific node with identity number 2 has been chosen, but if you prefer your site's blogs to be displayed you could substitute node/2 (in node/ID format) for blog, and a list of the blogs would be shown by default.

A good way to determine exactly how to display the front page you want is to actually browse to the page you want on your site. This could be your blog page, your aggregated news feed (more about feeds later in the book), or whatever. Once you are looking at what you want, take note of the relative URL path and simply enter that into the text box provided.

The relative URL path is that part of the page's address that comes after the standard domain, which is shared by the whole site. For example, in this case, setting node/2 works because Drupal maps this relative path to:

http://localhost/drupal/node/2

The first part of this address, http://localhost/drupal/ is the base URL (recall that you specified this in the previous chapter when configuring Drupal), and everything after that is the relative URL path.

Make sure, however, that everything works properly before moving on. Setting file paths can sometimes be a pain because it is easy to make a mistake and add an erroneous slash here and there—if you're like me, that is.

You can also display content by category by simply entering the correct relative URL path along with the category's ID number—this will require us to learn about how to work with categories before this is of any use, so it is left as an exercise. For the time being the default page of the site now looks like this:

General Settings

So far so good, but what did the final setting mean? Many of you may have noticed that whenever you make a request to Drupal, the URL of the page you are taken to looks something like this:

http://localhost/drupal/?q=node/add

This is the default form of URLs in Drupal, and it is unfortunate because obviously the ?q= is not very attractive. Worse it may interfere with your site being indexed by search engines. Accordingly, you can remove this from your URLs by enabling the Clean URLs option. In order for this to work you must have the Apache mod_rewrite module enabled (this can be set in the httpd.conf file in your Apache installation). If you have installed Apache2Triad then this should already be the case, but when it comes to deploying your site to your live host you must ensure that they too have it enabled, otherwise you will have to disable Clean URLs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.218.147