Pages

Tuesday, September 4, 2012

Using tags and tagclouds to describe your content in Drupal


Tags and tagclouds are all over the web nowadays. Almost every blog or website has it. Setting up a tagging system in Drupal is very easy. If you are using Drupal as a weblog, this might be a great feature for your website. Heck, it is a great feature even if you're not using Drupal as blog.
First, let's see what tags and tagclouds are. Tag is like a description. Itdescribes some piece of content. So, if you were writing a page about your summer holiday in Greece, you would "tag" (describe) that page with these tags:
vacation, holiday, summer, Greece...
Well, you get the idea. The point is, you can put as many tags as you want. In other words, you can describe your content with as many words as you can. That way people can have an idea of what your article is about before they even read it.
Look at this article at the top (or any other article on this website). It has several tags associated to it. And also, there is a "Tags" block on this website, which lists all the tags that I have used to describe all articles. It makes a so-called "tag-cloud".
ok here we go :) Enough theory, let's set up tags and show that wonderful tagcloud :)
  • Go to Administer > Content management > Categories. We have to add new vocabulary for our tags. So, click "Add vocabulary".
  • For "Vocabulary name" write "Articles". It makes sense to name our vocabulary "Articles", because we are writing articles on our website.
  • Under "Types", select type of content that you would like to associate with this vocabulary. In my case it is "Page" type of content.
  • For "Hierarchy" select "Single".
  • Check "Free tagging".
  • I would recommend you check "Required" as well. That way you will be forced to "tag" every node you create for the content type you've selected. If you are tagging, then tag'em all :-)
  • Click Submit
  • Download and install Tagadelic module for Drupal.
Now, when you create some articles, and when you tag them, your content will be described or "tagged". Tagadelic module will automatically create block for every vocabulary that you are free-tagging. So if you go to "Administer > Site building > Blocks", you will find block named "tags in Articles". Go ahead and make it visble somewhere (left or right sidebar).
There! Now your tagcloud is ready. What's cool about tagadelic module is that it gives you tagcloud with tags that are displayed with fonts of different sizes - according to their "weight". Weight is actually how many times you have used a tag to describe a content. The bigger font size is - greater weight a tag has, which means you have used that tag a lot.
As you are adding more and more articles, meaning as you are tagging more and more content, your tagcloud will be automatically updated with weights. It's pretty cool stuff. Also, don't forget to play around with Tagadelic settings in Administer > Site configuration > Tagadelic configuration.
Happy tagging!

What is important when it comes to Drupal web hosting?


How to find good Drupal web hosting? Well, just like any other web application, Drupal requires that you have PHP support and access to MySQL database (PostgreSQL is also supported by Drupal). However, this is not enough for Drupal to run smoothly. You need several other things to have on your hosting in order for your Drupal website to run without any problems:

- Drupal is best if you run it on Linux platform. Personally I suggest you to go for Linux based web hosting, because it is much more stable and secure than Windows hosting.

- Easy to use Control Panel that will allow you to create new databases and do everyday tasks. Usually all web hosting companies will give you cPanel, which is a pretty good Control Panel system.

- Your web host should allow you to easily create, modify or delete existing databases and change permissions on those databases. This should be done inside Control Panel.

- phpMyAdmin script installed so that you can easily manipulate data in your existing databases, execute queries on your own and backup your databases.

- Drupal requires cron job set up on every 24 hours in order to run smoothly. This one is very important for your Drupal website, as Drupal must perform certain actions automatically every 24 hours (or often). So it's important that your web host have cron editor where you can set up your own cron jobs.

- Next you need a very fast connection to the database. This is because Drupal heavily depends on database system and have many queries that need to be executed very fast. The web hosts that I recommend all provide you with fast connections to the database system.

- You need excellent customer support. As always, you may run into problems with your Drupal installation or you just might have questions that need to be answered. Excellent customer support is a must when it comes to Drupal web hosting.

- The ability to host multiple domains on 1 hosting account. This is very attractive feature of Drupal. You can have as many web sites using only one instance of Drupal web application. This means that every domain will use its own database, but all domains will use one same instance of Drupal. This way you save on your web space. This feature is really cool if you want to have many Drupal websites on 1 hosting account.

Wednesday, August 29, 2012

Drupal Website Building Tips - Part 6


Upload and download files

Whether a file is available for private or public download depends, of course, whether the page to which it is attached is available privately or publicly. In addition, there are methods for maintaining private download folders (for FTP or other access).

Public files / attachments

In general, files are "attached" to a page. See Uploading files with Drupal for information about changing permissions.
  • Attach a file to an existing page (examplepage):
Drupal -> Administer -> Content Management -> Content -> examplepage -> edit
-> File attachments -> Attach new file: your file to upload -> Attach -> Save

Increase uploaded file size limits

Add a quotation module

Add the Fortune module to Drupal

Fortune is a *nix utility to display quotations from preselected files. Drupal has a plugin to display these quotations from within a webpage. Although a nice module, a disadvantage is that it uses monospace font and currently does not have options to adjust the font type and size. See here for installation details.

Add the Quotes modules to Drupal

  • Download the Quotes module:
cd /etc/drupal/6/all/sites/modules
sudo wget http://ftp.drupal.org/files/projects/quotes-6.x-1.40.tar.gz
sudo tar zxvf quotes-6.x-1.40.tar.gz
sudo rm quotes-6.x-1.40.tar.gz
Note: If you wish this module to be available to only one subsite, then install it instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Site building -> Modules -> Other -> Quotes (ticked) -> Save configuration
  • Create a Quotes content and import your quotations. You can create a quotation one by one, or a large number of Quotations all at once (from a file, for example). Each quotation is created as an individual content item. The "display in Quote blocks" option determines whether a Quotes block (created in the next step to display a rotation of the quotations) will include the particular quotation(s) created in this step.
Drupal -> Create content -> Quotes
->Name: Quote%id -> Display in quote blocks: (ticked)
I use quotations from the Fortune program, which are in a particular text file format that looks like:
I reject your reality and substitute my own...
%
This is one of those "What the hell am I doing?" moments, over!
%
We got a robot in the water, he's stuffed with tuna and it's just another day here at Mythbusters.
I copy the contents of the text file into the input box.
-> Format: Import Fortune file -> Comment settings: Disabled -> Save
This will create as many content items as are in the Fortune file. If there are hundreds of quotes, you will have hundreds of Quote content items.
  • Configure the Quotes settings so that Quotes can appear as a block:
Drupal -> Administer -> Site configuration -> Quotes
-> Configure blocks -> Name: Quotes -> Add block -> Configure block
-> Update options -> Update every 6 seconds
-> Show block on specific pages -> Show on only the listed pages: choose the pages to display on
-> Save block
  • Add the Quotes Block on your site:
Drupal -> Administer -> Site building -> Blocks -> Quotes:Quotes -> Location

Drupal Website Building Tips - Part 5


Use an SMTP server for email functions

I don't have a mail server on my system. Instead, I use an offsite mail handler that accepts the SMTP/POP3 protocols. Drupal can be configured to route its mail through SMTP/POP3 as well. If you are using SMTP, make sure outbound port 25 is open. If using secure SMTP (i.e. through SSL), then make sure outbound port 465 is open.

Install PHPMailer

  • Install the PHPMailer libraries on Ubuntu:
sudo apt-get install libphp-phpmailer
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/phpmailer-6.x-2.1.tar.gz
sudo tar zxvf phpmailer-6.x-2.1.tar.gz
sudo rm phpmailer-6.x-2.1.tar.gz
  • Copy the necessary files from the libphp-phpmailer Ubuntu package into the module directory:
sudo mkdir /etc/drupal/6/sites/all/modules/phpmailer/libraries
sudo cp /usr/share/php/libphp-phpmailer/class* /etc/drupal/6/sites/all/libraries/phpmailer
Note: If you wish these modules to be available to only one subsite, then install them instead into the /etc/drupal/6/sites/mysite_x/modules folder.
  • Note: You must update after module installation.
Drupal -> Administer -> Modules -> Mail -> select PHPMailer module functions to enable
  • Enter your SMTP settings:
Drupal -> Administer -> Site configuration -> PHPMailer

Add an online store to your website

Drupal has a completely free and powerful online store called Ubercart. Other solutions include Zen Cart and osCommerce.

Set up PayPal Website Payments Standard

  • Establish a bank account at your financial institution to be used exclusively with PayPal. Do not use your regular bank accounts, as PayPal will have access to both deposits and withdrawals from this account. (You can use a savings account, as all transactions between PayPal and the account will be electronic.)
  • There are basically two types of payment schemes for PayPal:
  • Website Payments Standard -- no monthly fee. 2.9% + $0.30 per (attempted) transaction. The customer goes to the PayPal site for payment then returns to the website.
  • Website Payments Pro -- $30 monthly fee. 2.9% + $0.30 per (attempted) transaction (less if significant volume). All transactions are performed through a gateway, without leaving the website.
  • In addition, there is Express Checkout for PayPal registered customers. The customer goes to the PayPal site then returns.
  • Until your needs are greater, Website Payments Standard is the least expensive solution to use. Create a PayPal Premier account. (The Premier account allows you to both buy and sell items.) Verify your email address and bank account. To verify your bank account, use the "Confirm deposits" method. (The instant verification method involves giving your secure online banking information (regarding your bank account) to PayPal, which is strongly advised against.) Verification of your bank account is a 4 day process, in general.

Create a PayPal Donate button

  • While logged in to the PayPal site, create your button(s) for donations (or payment or checkout) through the PayPal website.
PayPal -> Merchant Services -> Create Buttons -> Donate
  • Customise your button(s) as desired. When you "Create button" or "Save changes," the code for the button will be displayed. Copy the PayPal button code.
  • On your Drupal website, create a new block in which to display the newly created button. In this example I will place this new block in the right sidebar.
Drupal -> Administer -> Site building -> Blocks -> Add block ->
  • Block description: PayPal block
  • Block title: Donations
  • Block body: Paste the code from your PayPal button here
  • Input format: Full HTML
  • Customize other settings as desired -> Save block
  • Place the newly created block into the right sidebar:
Drupal -> Administer -> Site building -> Blocks -> PayPal block -> Disabled -> Dropdown: Right sidebar -> Save blocks

Install Ubercart on Drupal

cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/token-6.x-1.12.tar.gz
sudo tar zxvf token-6.x-1.12.tar.gz
sudo rm token-6.x-1.12.tar.gz
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/ubercart-6.x-2.0.tar.gz
sudo tar zxvf ubercart-6.x-2.0.tar.gz
sudo rm ubercart-6.x-2.0.tar.gz
Note: If you wish these modules to be available to only one subsite, then install them instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Modules -> Ubercart -> select the Ubercart module functions you intend to use
  • PayPal requires cURL. Install the curl-php library in Ubuntu/Kubuntu (see this link for more info):
sudo apt-get install php5-curl
sudo /etc/init.d/apache2 restart
Drupal -> Administer -> Store administration

Setup PayPal with Ubercart

  • Undergoing revisions.
  • Check that a payment has been processed:
Drupal -> Administer -> Store Administration -> Orders -> View by status: Payment received

Trigger functions based on payment

The benefit of using Ubercart in Drupal is that access to website functions can be triggered based on a payment regimen. For example, access to webcam modules (such as videochat or webcams) can be enabled (using the ContentAccess module) after payment is processed by Ubercart through Paypal. This allows consumer-based telemedicine, a very desirable service for physicians.
Ubercart allows actions to be triggered, predicated on conditions being met (such as a PayPal payment notification being received). This can include the startup of other modules.
Drupal -> Administer -> Store administration -> Conditional actions

Add realtime videochat to your website

(This section under construction).
The following modules add videochat to Drupal:

Add BigBlueButton API

  • BigBlueButton is a standalone videoconferencing server. Install the BigBlueButton API that is able to call the BBB server from within Drupal:
cd /etc/drupal/6/sites/all/modules
sudo wget http://ftp.drupal.org/files/projects/bbb-6.x-1.x-dev.tar.gz
sudo tar zxvf bbb-6.x-1.x-dev.tar.gz
sudo rm bbb-6.x-1.x-dev.tar.gz
Note: If you wish this module to be available to only one subsite, then install it instead into the /etc/drupal/6/sites/mysite_x/modules folder.
Note: You must update and adjust permissions after module installation.
Drupal -> Administer -> Modules -> Big Blue Button -> select the Big Blue Button module functions you intend to use
  • Test the BigBlueButton settings:
Drupal -> Site administration -> BigBlueButton Conferencing -> Test connection.
  • Change the URL to the address of your BBB server (e.g. http://mybbbsite.dyndns.org:81/bigbluebutton/) and the Security Salt (found in bigbluebutton.properties on the BBB server in the
/var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties
configuration file, in the setting:
beans.dynamicConferenceService.securitySalt=your_security_salt_number_here
  • Create a new content type named Teleconference:
Drupal -> Administer -> Content management -> Content types -> Add content type
-> Name: Teleconference -> Type: teleconference -> Big Blue Button settings -> Treat this node type as conference: (ticked) -> Show links to join / start a meeting beneath the node: (ticked) -> Display meeting status on node: (ticked) -> Save content type
  • Create a new node of content type Teleconference:
Drupal -> Create content -> Teleconference -> Conference settings -> ...

Add Kaltura video services

  • See these instructions for adding the API for the community edition of Kaltura, a video editor and manager for your website.