How I created this site with Drupal (II)

Tagging the content: taxonomies


This IS FOR us one OF the most wondeful aspects OF Drupal. It IS very easy TO CREATE a taxonomy (activate the taxonomy MODULE!) OF vocabulary terms that can be used TO tag the pages AND stories IN your drupal site. THEN, you can use views (see below) TO automatically organize the content based ON these tags.

The CURRENT taxonomy OF this site IS the following:

 editor />

Note that this taxonomy mixes two things: tags about the content (UML,OCL,…) AND tags about the possible types OF resources FOR the content (books, articles,…). Therefore, we could have defined two different taxonomies. However, since you can define that the same page can be annotated WITH several tags FROM the same category, the final result IS exactly the same AND since our taxonomy IS NOT that complex we preferred TO keep it simple.

Views


Once the context IS tagged, instead OF manually organizing the content IN our site, we can just define a VIEW that automatically selects AND presents the content we want TO show IN a given page. FOR instance, our UML page shows links TO ALL pages annotated WITH the UML tag. The configuration OF this VIEW IS the following:

view width="600px"/>

The fields part describes the fields OF the selected nodes that will be shown IN the page. IN this CASE we just show the title OF the node (e.g. UML books) AND the LAST UPDATE DATE. Clicking ON the title field we can SET the title TO be displayed AS a link TO the target node. The Sort settings allow TO define the ordering OF the nodes IN the VIEW (IN our CASE, ascending ordering by NAME). The filters part represents the SELECT condition FOR the VIEW: ONLY published nodes, IN the same LANGUAGE AS the CURRENT one selected by the USER (this means that content that it IS NOT translated OR written IN that LANGUAGE will NOT be shown) AND tagged WITH the UML term.

If you have several views WITH the same structure (maybe just changing the taxonomy term used IN the content selection) it IS a good idea TO CREATE AND test the FIRST VIEW AND WHEN you ARE happy WITH the results clone the VIEW TO CREATE a basic definition FOR the others.

Adding a blog


A Drupal site can host a blog FOR each registered USER (if we allow them TO do so, AS configured IN the permissions MODULE). This need TO be adapted a little BIT if we just want TO have a single site blog.

FIRST, we need TO change the URL TO go FROM the DEFAULT “http://modeling-languages.com/blogs/username” TO “http://modeling-languages.com/blog” by redirecting the URL. SECOND, we need TO change the DEFAULT NAME FOR the blog, FROM “username’s blog” TO (IN our CASE) “software modeling blog”. The NOT-recommended way OF doing this would be TO replace IN modules/blog/blog.pages.inc the string $channel['title'] = $account->NAME .”‘s blog”; WITH “$channel['title'] = “Software Modeling blog”; . Note changing this violates all Drupal best practices since we are modifying one of the drupal core modules. This can also be done by installing the Strig Overrides module and indicating that the default for the blog name should be changed by the desired one. This does not change the real name of the blog, just the way it is displayed. This means that RSS feeds from our blog will still show the default name (in our case, we fixed this by using feedburner as RSS provided and changing the RSS name there). The new “Blog title” module may solve the problem in a near future

Useful modules to complement your blog are the tracker module (to enable tracback on your posts), the service links module (to automatically add icons to bookmark, search and share the post using some of the most common services) and the comment count image (that shows the number of comments for the post).

RSS feeds


Each page in drupal can have its own RSS feed. The syndication module allows visitors to get the RSS feed of a given page and also creates a new page where visitors can create their own RSS feed by selecting specific contents they want to follow (e.g. using the tags created before). However, in our case, we just wanted to provide two types of feeds (in two different languages), one for the front page and the other for the blog. So, we though it would be easier to create our own custom page where the users can select which one of the two RSS feeds they want.

rss feeds />

Moreover, instead of using the default RSS feeds, we use feedburner to provide the feeds. This way we may know how many subscribers do we have (counting strategies on the default feeds we were able to find on the web were not convincing).

Internationalization


Having a multilingual drupal site is now easier than ever. With the locale module you can translate the interface and with the Internationalization module, you can translate the content. There is not much more to say here. Look at
this tutorial
for more information. Just a couple of remarks, in Language configuration we use “Path prefix ONLY”. With this the language of the requested page is determined by checking whether the URL contains the language prefix (note that all URLs in our site are the exactly the same in both languages except for the prefix /es/ in the Spanish ones).
We are having some problems to setup the links for some menu items. An easy solution is to duplicate the items and show only the appropriate one depending on the selected language.

Backup


A complete backup requires two things: backup the files and backup the database. To backup the files we just zip them and download the zip with FTP, simple and easy. To backup the database we use the “Backup AND Migrate” module that exports the database content in a .txt file with the SQL sentences required to recreate the database.

Therefore to restore the drupal site we just need to extract and upload again the zip file and load the contents of the database backup. The script drops the tables before recreating them so you don’t need to delete the old database contents.

Do not forget to check the continuation of this post in the third part of this series!


Lunarpages.com Web Hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress