Skip to main content

Setting up a Drupal site: Notes to self


This is just a collection of jots I ( = a Drupal newbie) wrote down as I set up a site with Drupal 7.2. Don’t expect this to be more coherent than a typical shopping list.
And now I appreciate how easy it is to install and use WordPress. The parallel tasks on Drupal are so amazingly difficult.

General remarks

  • Take a look on the module list which is sorted by number of installations by default. The things you want are most likely in the beginning of this list.
  • Use URL aliases for every post. A node number says nothing and it’s a clear loss of Google juice.
  • CKEditor allows the insertion of a DIV container, for which, among others, the language direction can be chosen. This is a great thing for Hebrew, Arabic and other right-to-left languages.
  • Drupal’s taxonomy is hierarchical, so the site’s hierarchy can be implemented by setting up a hierarchy of terms within a certain vocabulary, and then tag nodes (pages) in order to place them in the menu hierarchy.
  • Flush the entire cache every now and then when changing things.
  • The administrative menu gets less quirky as time goes by. Go figure.
  • Structure > Blocks is where blocks are added to or removed from the site globally.
  • Special pages are best done as Panels. Note that a panel page is just like a normal page with all the blocks around it.

Milestones in setting up the site:

  • Enable clean URLs
  • Enable book module
  • Installing a rich text editor (duh…). I went for the classic WYSIWYG module (see below)
  • Remove the “powered by Drupal” footer (with all due respect)
  • Themes go to tar -xzf in sites/all/themes. Switch themes through Appearance (not any submenu)
  • Downloaded and installed (tar -xzf in sites/all/modules) pathauto,  ViewsTaxonomy Menu, (CCK is part of Drupal 7),  Administration MenuIMCE (image uploader, I’ll do that manually), Backup and Migrate, and PanelsCtools was installed as well for Panels. Same goes with Token for pathauto.
  • And then enabled the modules, of course.
  • Set up cron. I got a lot of “access denied” in the beginning, and then I realized that I should get the link with the cron key under Reports > Status Reports. And then I found out that cron.php denies access when in maintenance mode. So start the cron thing only when the site goes online.
  • Set the default page: Configuration > System > Site Information

Installing the WYSIWYG module

Spoiler: The clear winner is CKEditor. Given the possibility to do HTML editing at all times, I can’t see any reason to pick another editor.
  • Downloaded from here.
  • tar -xzf at sites/all/modules/.
  • Created a “libraries” directory under sites/all (why wasn’t it already there?)
  • Downloaded CKEditor and did tar -xzf at the “libraries” just created. Be sure that CKEditor wasn’t released after Drupal, because it may not install, and the message “The version of CKEditor could not be detected” will appear at “Wysiwyg profiles”
  • Downloaded NicEdit (default configuration), created a “nicedit” directory under “libraries” and unzipped the file there.
  • Downloaded YUI, and unzipped it directly on “libraries”
  • On web interface menu: Configuration > Text Formats > Add Text format. Add a new text format, e.g. NicEdit and set it for use only for admins (for example).
  • Then on web interface menu: Configuration > Wysiwyg profiles assign NicEdit text format to NicEdit editor
  • Then on web interface menu: Configuration > Wysiwyg profiles > edit NicEdit > Buttons and plugins and check all checkboxes (TAB and space bar came handy). Or the rich edit box looks like just a plain text box. Why this extra step was necessary is pretty much beyond me.
  • Same procedure for other editors.
  • Make CKEditor start the spell checker (SCAYT) by default. Change public_html/sites/all/libraries/ckeditor/_source/plugins/scayt/plugin.js to say config.scayt_autoStartup = true; (I’m not 100% sure this worked)

Setting up a taxonomy menu structure

The sequence below is based upon the Administration Menu module (things may be found in other places using the core interface):
  • Create a new menu:  Structure > Menus > Add Menu
  • Create a new vocabulary: Structure > Taxonomy > Add Vocabulary.
  • Generate a few terms in the new vocabulary
  • Edit the new vocabulary. Under “Taxonomy menu” pick the the new menu, and check the “Select to rebuild the menu on submit” checkbox. This copies the taxonomy items into the menu (not very sophisticated, is it).
  • Now on Structure > Blocks > { your chosen theme } put the menu somewhere. Or more precisely, find the new menu in the list, and assign it a point of appearance. Don’t forget to submit the form.
  • To use the menu items as top-page tabs, go to Structure > Menus > Settings and set the source as the new menu
Note that new vocabulary items don’t appear automatically on the menu, and it’s not a matter of flushing the cache or running cron. The menus need to be updated by rebuilding them as mentioned above.
So the bottom line is that I tend to trash the Taxonomy menu and use the book structure.

Tagging pages

  • Go to Structure > Content Type > { The content type to alter } > Manage Fields
  • Add a new field of type “Term Reference”  and select any of the widgets offered.
  • Click Save settings
  • On the next page, you’ll be asked to choose the vocabulary to use. Save this as well.
  • On the next page set up the number of entries allowed (unlimited?) and default tag.
  • You may want to hide this field in the display (if it’s for internal uses): Structure > Content Types > { The content type to alter } > Manage Display and set both label and format to hidden. Be sure to apply this to all view modes, full content in particular.
  • But hey, you want to see these tags yourself! So create a new view: Structure > Views > Add new view and set up a block view of taxonomies (no point in making a page).
  • I would go for the grid, by the way.
  • Now edit the view, click Advanced > Relationship > Taxonomy term: Content using {name of tag field in content type}. Check “Require this relationship” (or why would this be useful at all?)
  • Dont forget to Save…
  • Add the block to the theme:  Structure > Blocks > {The theme} making sure it’s visible to admins only.

Themes

These are my very shallow impressions of a few selected themes I checked up for a hi-tec site. I checked with Firefox 3.6 and IE6 to get a wide range of compatibility issues.
  • 0-point: Beautiful and sleek on Firefox, complete disaster on IE6.
  • Aqua Marina: Not bad, and survived IE6 test fairly OK, but still pretty bad. Doesn’t have a hi-tec look, though.
  • Danblog: Simple & to-the-face design pretty suitable for a hi-tec site, but looks a bit too simple maybe. Survived the IE6 test very well (no differences).
  • Danland: Same impression as Danblog. The differences are possibly deeper in.
  • Fusion was obviously not intended to be used out of the box.
  • Garland looks great, and not so bad on IE6 (resize issues on the latter). Not really a hi-tec look (top region should be bright)

Comments

Popular posts from this blog

Shell Script to check tomcat status and restart

The below script checks the status of a particular tomcat status and restarts it if the tomcat does not respond....TOMCAT_HOME=/usr/local/tomcat-folder/

is_Running ()
{

        wget -O - http://yourserver.com/ >& /dev/null
 if( test $? -eq 0 ) then
  return 0
 else
  return 1
 fi
}


kill_Hanged_Processes ()
{
 echo "killing hanged processes......"
 javaProcs=`ps -efl| grep -v grep | grep java`
 if(test ! -z "$javaProcs") then
  echo "nonzero"
  processId=`echo $javaProcs | awk '{ print $2} '`
  echo "$processId"
  kill -9 $processId
 fi
}
stop_Tomcat ()
{
 echo "shutting down......"
 $TOMCAT_HOME/bin/shutdown.sh
}

start_Tomcat ()
{
 echo "starting......"
 $TOMCAT_HOME/bin/startup.sh
}

restart ()
{
 stop_Tomcat
 sleep 10
 kill_Hanged_Processes
 start_Tomcat
 sleep 60
}

send_Mail ()
{
#!/bin/bash
# script to send simple email
# email subject
SUBJECT="Telegraphindia.com went down"
# Email To ?
EMAIL="mailid1@gmail.com,mailid2@gmail.com"
# Em…

Getting access to menu from portlet in liferay

The below code describes the way of accessing menu items from the portlet. Here i have called it from jsp. The best thing about this is you can use the beautiful permission management of menu items of liferay as well without bothering about that. Writing services for fetching menu names from the layout tables will need more codes for permission managements......

Hope this helps.........


<%--
/**
* Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ page import="com.li…

Virus f Opyum Team

Symptoms :: 
Several processes running named f or i. 
Network choked
Apache Dead
Unknown entry  * * * * * root f Opyum Team in crontab

Investigate ::
Try to kill the f process and even root will be unable to kill it. Check file named f and i in /etc or /bin or /usr/sbin directory. Try to delete, the file f  will not delete.  Some unknown .jpg files will be there in the same folder. 

Solve :: The root is unable to delete the file f because of the immutable bit in f
To remove it use ses or chattr
Follow the below steps to remove it completely.....



remove the unknown .jpg files in system folders

#top
(kill process f) option k

#ses -i /bin/f
#rm /bin/f
#ses -i /etc/crontab
#vi /etc/crontab (and delete last line)
#reboot


Precautions ::  In my case the server was hacked bu Brute-force attack
So set a good password with a combination of upper,lower case letters and special characters.

Post your feedback or any issues you may face removing the virus.  Very less number of good threads are there explaining …