Skip to main content

Blog Page

Blogs

Non-existent URLs in Views 2

Views 2 serves pages with for non-existent URLs instead of presenting a 404 Not Found Error. A view with page display path set to blog creates a valid link at example.com/blog. This will show a list of blog posts, with an individual article at example.com/blog/new-article. However, an accidental link to example.com/blog/accidental-link will provide content from example.com/blog instead of the expected 404 Not Found Error, since no valid content exists there. This is a usability as well as SEO issue. Searching discussions on Drupal and Groups.Drupal yielded the right answers. The solution is to

Hierarchical site and menu structure

Since Drupal stores all pages in a database, the webmaster is responsible for creating a hierarchical organization of the content. The visitors and search engines then navigate through a logically subdivided site structure. Native Drupal URL for a page is example.com/node/271 or example.com/?q=/node/271. A user- and SEO-friendly URL is website.com/section/article Modules needed: Menu (core) Path (core) Pathauto Token Ensure that Clean URLs (/admin/settings/clean-urls) are enabled. Open the Pathauto admin control panel - Administer > Site configuration > Pathauto Expand the Node path settings

Limit Autosubscribe to Enabled Nodes

Messaging and Notifications are popular Drupal modules that can be used for a website forum to notify original poster of replies, or an administrator of comments posted for a specific content type. When 'Set all users to "autosubscribe" by default' is enabled in admin/messaging/notifications/content, it generates notification subscriptions even for node types that are not enabled. In other words, all nodes created by a user automatically get a new subscription. This may be troublesome, especially when creating new content on the site - at the very least creating numerous useless subscriptions

Image Protection with jQuery

Once an image is publicly available on the internet, there are many ways to make a local copy of it. There are also a number of ways that try to prevent such unauthorized downloads. Preventing right click / save of the image is most likely the easiest way to protect the casual drive-by image theft. How to incorporate it within a Drupal theme? 5 lines of code. Within the theme directory, create (if it doesn't exist) or edit script.js. This file will be loaded automatically with the rest of the Drupal jQuery. $(document).ready(function(){ $('img').bind("contextmenu",function(){ return false; })

CKEditor and GeSHi filter

Update: This approach does not involve the WYSIWYG module. It relies on the installation of CKEditor (module and editor) without a middleman management module. If you desire finer control of toolbar display by roles or HTML functionality permissions, take a closer look at the Better Formats module. It is easier to focus on content when working with a WYSIWYG editor. I can always switch to view the source code if I need to do more complex editing. As I continue to document my Drupal experiences, I wanted to use a syntax highlighter when sharing code samples. First, I looked at the Syntax

Daily emails from chkrootkit using postfix / sendmail command

You have installed chkrootkit and it's now running with daily cron, but unless you are logging in daily to check the logs, you won't know of any potential problems. Here's a simple way to have the daily report emailed to you with only postfix installed, using the sendmail command. Edit /etc/chkrootkit.conf and add the following REPORT_EMAIL="[email protected]" Edit /etc/cron.daily/chkrootkit and towards the bottom of the file, replace $CHKROOTKIT $RUN_DAILY_OPTS with $CHKROOTKIT > $LOG_DIR/chkrootkit.log #Run chkrootkit and save the logfile ( echo "Subject: [chkrootkit] $(hostname -f) - Daily

Presenting at Southwest Drupal Summit

Southwest Drupal Summit 2011 will be held on January 27-28, 2011 in Houston. This weekday event will cater to the business side of Drupal development and will feature numerous featured speakers, including Dries via video from Australia! On Thursday, January 27, 2011 at 10:55 AM I will be presenting CiviCRM for Non-Profits and Small Businesses. Join in and learn about what an integrated CRM system can do for your organization! If you are following on Twitter, look up @SWDrupalSummit.

Presenting at SandCamp San Diego

SandCamp 2011 will be held on January 8-9, 2011 in San Diego with several hundred registered attendees and a great lineup of sessions. On Sunday, January 9, 2011 at 9:00 AM I will be presenting CiviCRM for Non-Profits and Small Businesses. Join in and learn about what an integrated CRM system can do for your organization! If you are following on Twitter, lookup @drupalsandiego.

Presenting at DrupalCamp Austin

Update: See the video after the jump! DrupalCamp Austin 2010 will be held November 20-21 with more than 300 attendees from all over the United States and as far away as Canada and Sweden. On Sunday, November 21, 2010 at 4:30 PM I will be presenting CiviCRM for Non-Profits and Small Businesses. Join in and learn about what an integrated CRM system can do for your organization! If you are following on Twitter, use #drupalatx.

Sort Multiple Formats of Date Fields in Views

Scenario: two or more content types. First content type uses a CCK Date field with date, hours, minutes, while the other content type(s) only need a date field without the hours and minutes. Because a CCK Date field sets the granularity globally, most users set up two different fields with two different granularity settings. This works well, until there is a need to display all of the content sorted by date - Views can't sort and/or merge two independent fields and then do a global sort. The answer is surprisingly simple. In the appropriate content type, define only one CCK Date field and set