Drupal - Create a sub-theme

In this tutorial, we will create a sub-theme of the Garland theme.

  1. Create a directory for your sub-theme(e.g. .../sites/all/themes/mySubTheme)
  2. Create an .info file for your sub-theme(e.g. .../sites/all/themes/mySubTheme/mySubTheme.info)
    name = Mysubtheme
    description = A tutorial showing how to create a sub theme.
    core = 6.x
    engine = phptemplate  
     
  3. Add the following line in your sub-theme's .info file to declare that your theme is the sub-theme of another.
     

Drupal - Install modules and themes

Install modules and themes

General steps to install modules, unless otherwise stated in the README.txt

  1. Decompress modules that you downloaded from http://drupal.org/project/modules.
  2. Put it in .../sites/all/modules.
  3. Go to Administer->Modules, check the modules.
  4. Click on the Save Configuration button.
  5. Click on the update.php link, located at the beginning of the page and follow the instructions.

General steps to install themes, unless otherwise stated in the README.txt

SQL - Search and replace string

UPDATE tableName SET fieldname = REPLACE(fieldname, 'replace this string', 'with that string');
 
--Replace Smth with Smith
UPDATE Person SET lastname = REPLACE(lastname, 'Smth', 'Smith');

Drupal - Themes development

Java - Use ResourceBundle and properties files to add multilanguage support to your application

import java.util.Locale;
import java.util.Properties;
import java.util.ResourceBundle;
import java.io.FileOutputStream;
 
/**
 * Show how to use ResourceBundle and properties files to add multilanguage 
 * support to your application.
 * Note: You will get the following error message:
 * java.util.MissingResourceException Can't find bundle for base name, locale...
 * If the properties are not placed at the right place. Here are the solutions:
 * 
 * 1)
 * Copy all properties into the build folder(e.g. bin\ folder)
 * or
 * 2)

Java - How to create and read properties file

import java.util.Properties;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
 
/**
 * Show how to create and read properties file.
 * @author Xuan Ngo
 */
public class MyProperties
{
  public static void main(String args[])
  {
    /**
     * Create and save the properties into a file.
     */
 
    // Create the properties object and add some values.
    Properties oWriteProperties = new Properties();
    oWriteProperties.setProperty("key1", "value1");

Selenium 2 - Overloading findElement() to add waiting time

Update: 2010-08-05:
It looks like overloading findElements() to add a wait time is no longer required. As of version 2.0a5, you can use RemoteWebDriver.RemoteTimeouts.implicitlyWait() like the following:
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS)

DocBook - Install xsltproc and FOP to generate a PDF from a docbook document

Install xsltproc

  1. Go here to download iconv, zlib, libxml2 and libxslt.
  2. Decompress all the files downloaded.
  3. Put the folder path of iconv.exe, libxml2.dll, xsltproc.exe and zlib1.dll in the environment variable PATH.
  4. Open Command Prompt and run xsltproc.exe. It should show something similar to the following:
    C:\>xsltproc -version
    Using libxml 20630, libxslt 10122 and libexslt 813
    xsltproc was compiled against libxml 20630, libxslt 10122 and libexslt 813

Varia - Install network driver of IBM ThinkCenter 8183-CTO

  1. Obviously, you need a computer that have access to the internet before going through these instructions.
  2. Go to http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-55649.
  3. Download q37z47us.exe
  4. Double click on q37z47us.exe and follow the instructions.
  5. Execute C:\IBMTOOLS\DRIVERS\Q37Z47US\APPS\SETUP\SETUPBD\W98-WS32\SetupBD.exe.

Info about the computer:

Drupal - Post images

Now that you know how to post. It would be nice that you will be able to post images in your posts. What you have to do is to allow <img> tag in your posts and activate Upload module so that you can update the images.

Configure Input formats to allow <img> in your post

  1. Go to Administer » Site configuration » Input formats.
  2. Click on the Configure link of Filtered HTML.
  3. Click on Configure tab.
  4. In Allowed HTML tags field, add <img>.
  5. Click on the Save Configuration button.
Syndicate content