Core Concepts

By adam
2015-05-29 21:08
3 comments

Awhile back I posted a video on setting up a Drupal sub-theme. If you want, you can check out that video here. I think that the video does an alright job of explaining the steps you have to take to get a sub-theme to work properly. I don't however think it provides enough of the setting up a sub-theme "meat" needed to begin. The saying goes, the devil is in the details. Personally, I never liked that quote, but it is fitting here.

By adam
2014-05-16 06:53
2 comments
Daily Dose of Drupal Episode #150

The Image Styles modules is part of Drupal 7 core modules. While simple, this module is a backbone to an enormous amount of use cases within Drupal.

In this episode you will learn:

  • How to create an image filed on a content type
  • How to create an image style
  • How to associate the image style with the content type
  • How cute bunnies are

There are some times in Drupal 6 where you push the limits of what the blocks interface can do. If you need to display the same block, multiple times on the same page, you will start to see these limitations. An example of where this is useful is a Newsletter signup form. Sometimes a client may want a newsletter signup form to be in the footer of every page, but also displayed more prominently on the contact form page.

By shane
2013-03-01 23:51
1 comment
Daily Dose of Drupal Episode #118

You may have heard of a Drupal installation profile but are not sure what a Drupal installation profile is or how you can write your own Drupal installation profile. This video will walk you through Drupal 7 installation profile basics, and also show you some examples of how installation profiles are developed. This episode is meant to be a getting started guide for those developers or site builders that want to get a basic grasp on Drupal installation profiles and how they can be used to build flexible and dynamic Drupal distributions.

Daily Dose of Drupal Episode #95

Drupal 7 has the ability out of the box to block specific IP addresses from accessing the site. On top of that, the Drupal User Restrictions module can be used to block specific usernames or email addresses from creating accounts on your Drupal website.

In this episode you will learn:

  • How to block IP addresses on a Drupal 7 website
  • How to use the User Restrictions module to block usernames and email addresses
By shane
2013-01-22 23:13
3 comments
Daily Dose of Drupal Episode #92

The Drupal 7 Form Builder module is a handy module for those new to building forms with the Drupal Form API. The module provides a nice, centralized interface for building out Drupal forms.

In this episode you will learn:

  • What is the Drupal 7 Form Builder module and why might it be useful
  • How can the Drupal 7 Form Builder module be used to export Drupal 7 Form API code.

I recently was helping a new Drupal developer with some issues after they attempted a Drupal update that really messed up their Drupal website. They were getting a bunch of Fatal errors that were causing the site to be completely broken. This user was on a Windows system running a Drupal 7 development site on their localhost. Here are the steps I tried and how I fixed the problem.

Download a new Drupal 7 core

By shane
2013-01-11 22:22
15 comments
Daily Dose of Drupal Episode #86

The Drupal 7 Entity Construction Kit Module (ECK) can be used to build your own entities on a Drupal 7 website. In this long episode of the Daily Dose of Drupal, I attempt to go through what I know about the Entity Construction Kit module and how it can benefit a site builder in order to build their own custom entities.

In this episode you will learn:

  • An overview of Drupal 7 entities and how the Entity Construction Kit can fit into the mix
By shane
2012-11-30 21:52
10 comments
Daily Dose of Drupal Episode #58

The Drupal 7 Field Permissions module can be used to customize the view and edit permissions on individual Drupal 7 fields. It is a very flexible permissions management system that gives the Drupal site builder fine grained permissions control allowing you to give certain users access view/edit fields while not allowing other users. It is based on the Drupal 7 roles system for allowing the setting of the field permissions to specific user groups (roles).

In this episode you will learn:

    By shane
    2012-10-04 23:22
    6 comments
    Daily Dose of Drupal Episode #22

    Continued from the last episode of the Daily Dose of Drupal, this episode continues Drupal 7 module development work with the Database API to pull data from the database and display it on a page.

    In this episode you will learn:

    • How to pull data from the Drupal database using the Drupal 7 db_query function
    • How to use db_select and the Database API's dynamic query building to pull data from the database
    • How to display data using a theme function to output data as a table
    Daily Dose of Drupal Episode #21

    This episode works off the the previous episode to create a custom Drupal 7 form using the Drupal Form API, and then looks at how to submit data from the Drupal form into a Drupal database table.

    In this episode you will learn:

    • How to use hook_menu, hook_permission, and drupal_get_form to create a custom Drupal form page
    • How to create a custom Drupal 7 form using the Drupal Form API
    • How to add a validation function to the Drupal 7 form
    • How to add a submit function the Drupal 7 form
    By shane
    2012-10-02 13:10
    4 comments
    Daily Dose of Drupal Episode #20

    In this example we create a new Drupal 7 module with the purpose of creating a database table inside our Drupal 7 module. We look at hook_schema and the Drupal Schema API to create a new database table.

    In this episode you will learn:

    • How to create a Drupal 7 module with an .install file
    • What hook_install, hook_uninstall, and other various installation hooks do inside your .install file
    • How to implement hook_schema in your Drupal 7 module
    • How to use the Schema API for create Drupal database tables
    By shane
    2012-10-01 23:54
    8 comments
    Daily Dose of Drupal Episode #19

    This continues on the module we started last time and shows how to implement hook_cron to run periodic tasks on your Drupal website. Also goes over hook_mail and the drupal_mail function for creating and sending email messages within your Drupal 7 module.

    In this episode you will learn:

    • How to implement hook_cron in a Drupal 7 module
    • How to implement hook_mail to set up email messages in your Drupal 7 module
    • How to trigger the sending of email in a Drupal 7 module with the drupal_mail function
    By shane
    2012-09-28 13:02
    5 comments
    Daily Dose of Drupal Episode #18

    Learn how to create an administration form inside a Drupal module. In this episode we work with the Drupal 7 Form API to build out an administration section for a brand new module. This new module (called cronmonitor) will be completed in the next Daily Dose of Drupal episode (number 19).

    In this episode you will learn:

    • How to build a Drupal administration form inside a Drupal 7 module
    • How to set the configure option inside your modules .info file
    • How to implement hook_menu and hook_permission to create an administration page
    By shane
    2012-09-27 23:50
    2 comments
    Daily Dose of Drupal Episode #17

    In this episode we continue learning about Drupal 7 module development by looking at creating menu items with hook_menu() and creating permissions with hook_permission().

    In this episode you will learn:

    • How to implement hook_menu() in you Drupal 7 module to create a new page on your Drupal site
    • How to implement hook_permission() in your Drupal 7 module to provide access control to your newly created page
    By shane
    2012-09-26 23:16
    0 comments
    Daily Dose of Drupal Episode #16

    In this episode you will learn the very basics of Drupal 7 module development. From the info file, Drupal hooks, and the module file, this is a crash course to get you started.

    In this episode you will learn:

    • How to create a very simple Drupal 7 module
    • How to create a Drupal 7 module .info file
    • How to create the main .module file
    • The importance of Drupal hooks and how they can be used to interact with the Drupal API
    • How to create a custom block inside your created Drupal 7 module using hook_block_info() and hook_block_view()
    By shane
    2012-09-18 10:50
    10 comments
    Daily Dose of Drupal Episode #10

    In this episode we will go over how to add a contact form to a Drupal 7 website using the Drupal contact module. In this episode you will learn:

    • How to use the Drupal 7 core contact form module to display a simple contact form on your Drupal site.
    • How to set up the Drupal contact form to send emails to different email addresses depending on the topic of the contact form submission.
    By shane
    2012-05-29 11:50
    3 comments

    For consistency's sake it is always a good idea to output any file download links the same way throughout any website. If you are using file uploads attached to nodes on your Drupal 7 website, this is generally taken care of for you. You will notice that all file links are displayed with a consistent icon set (which can be overridden), as well as a consistent link. This applies to all node pages and any views that contain the downloadable files.

    By shane
    2011-09-01 09:16
    3 comments

    I recently wanted to create a comment system that was threaded but only allowed one level of replies. Basically I wanted something like this:


    -Comment 1
    ---Reply 1-1
    ---Reply 1-2
    -Comment 2
    ---Reply 2-1
    ---Reply 2-2

    I still wanted to show all the reply links in the comment, however if a user tried to reply to an already indented comment, I wanted it to just add it to the bottom of the thread. For instance, clicking the reply link on "Reply 1-1" in the example above would add a "Reply 1-3" comment directly below "Reply-1.2". Make sense?

    By shane
    2011-03-16 22:00
    0 comments

    So one day I wake up to a phone call from a client saying their website was broken. After looking into it, I was able to determine that the website itself was working fine, however there were now red error messages showing up on almost every page. After further looking, they were not really errors, they were PHP notices. The notices sprung up during server upgrades that migrated from PHP 5.2 to PHP 5.3. At the time, we ended up just changing the PHP error setting to no longer display notices, and the crises was averted. however looking back now we could have done it this way.

    Subscribe to Core Concepts