Planet Drupal

Search API has been my go-to module for building search pages for the last two years. Even if the client doesn't ask for anything fancy, I still download and install Search API, use Database Search for the index and Views for the page.

If you start with Search API from the beginning, then it's easier to customise later on. The core Search module, on the other hand, is easy to setup but hard to modify.

Recently, I had to create a search page that highlighted the keywords in the results. If you search using a particular keyword, then the word is highlighted.

View modes allow site builders to display the same piece of content in various ways. Drupal ships with a bunch of them out of the box like Teaser, "Full content", RSS and much more. There is even one for the search result page called "Search result". However, the two most prominent are Teaser and "Full content".

The "Full content" view mode is the one used to display content on its "node/123" page. It's the one you'll customise the most. Teaser, on the other hand, is used to display a summarised or trimmed down version of an article.

You can create as many view modes as necessary. But like many things in Drupal, they can be created in a few ways. They can be implemented using code and with a module or two.

In this tutorial, you'll learn how to create view modes in three ways: using hook_entity_info_alter(), using Display Suite and Entity view modes.

When you need to dynamically display a block within a region, nothing can really beat the Context module. It allows you to define a set of conditions, that when met, executes a set of reactions. For example, you could create a context rule which adds a block to the sidebar second region (reaction) when a user is viewing an Article content type (condition).

A lot of what Context does can also be achieved using Panels. But if you're new to Drupal, and never used Panels than Context will be easier to use.

If you're new to Context then I would highly recommend you watch the two introductory videos below:

Recently I've discovered a powerful module called Context entity field. It allows you to define a condition that checks the value of a field on an entity.

Every Drupal site builder will at some point experience the dread of accidentally making configuration changes on production thinking it's their local site. This sort of thing can easily happen when you have 20 tabs opened and forget which site you're currently browsing.

Luckily there's a module you can use to indicate which environment (local, staging, production, etc.) you're currently viewing and it's called Environment Indicator.

The module helps to separate each environment by displaying a coloured indicator. The indicator itself is fully configurable. You can change its colour, position and text.

In this tutorial, you'll learn how to create an indicator in two ways: through the module's UI and with some code in settings.php.

Whenever I post a tutorial about sending emails using Drupal, the first question I get asked is how to send emails as HTML. By default, emails are sent as plain text in Drupal 7. There are a few modules out there that allow you to send emails as HTML like Mime Mail, HTML Mail and Swift Mailer.

There are a few benefits in sending emails as HTML. For one thing, they can be styled and images can be displayed. Also, it's easier to track open rates and clicks if the email is HTML. However, there are some downsides to using HTML. One thing I've read about is that HTML emails are more likely to be flagged as spam. Especially if your whole email is just a single image.

In this tutorial, you'll learn how to use Mime Mail to configure Drupal to send HTML emails. We'll also look at how to send them using Rules.

The standard look and feel of Bootstrap is unmistakable and often you can spot a website using it a mile away. The dead giveaways are the buttons and navigation, but it doesn't have to be this way.

If you want to change the look and feel of your Bootstrap site then take a look at Bootswatch. It offers 12 great looking themes, and best of all they are free and open source.

In this tutorial, we'll learn how to use a Bootswatch theme in two ways. The first method will show you how to use the BootstrapCDN and in the second we compile the LESS files ourselves.

So you created a module that you want to put on drupal.org. But just before you release it, you realise it could do with a few default views.

You may think you can use Features for this, but Views allows you to ship default views by creating a module.views_default.inc and implementing hook_views_default_views.

Now, Ctools can be used to generate the required export code that needs to be placed in hook_views_default_views. We'll use a sub-module in Ctools called "Bulk Export" to generate the code.

It's important to understand that there is a difference between "Bulk Export" and Features. The difference is that you can only export CTools' configuration objects using "Bulk Export". Whereas, Features offers full API for integrating any module with it.

In this tutorial, you'll learn how to export default views using "Bulk Export".

When it comes to managing the look and feel of a content page, nothing can beat Display Suite. It's become an essential module for when you need to change the layout and fields on a node or any entity page.

Today I want to talk about a piece of functionality that you may not be aware of in Display Suite. It's the ability to switch the view mode will be used for an individual node.

Let me explain, when you go to a node page (node/1) the "Full content" view mode is displayed. But, you can only have a single version of this view mode for each content type.

Display Suite can be setup to allow authors to select a specific view mode on an individual node.

Instead of displaying "Full content", you could, on a select group of nodes use another view mode called "Feature landing page".

This functionality is not exclusive to Display Suite. You can do similar stuff using Panels or Panelizer.

In this tutorial, we'll create a custom view mode called "Full content feature" and we'll allow an editor to select which one will be used on individual nodes.

Bootstrap is a mobile first front-end framework that allows a developer to build websites quickly. The framework comes with a lot of reusable CSS styles, components and jQuery plugins.

One thing I like about Bootstrap is its CSS styles and components. You get access to all sorts of useful things like Tables, Thumbnails and more.

Now, implementing these components in Drupal can be tough. You can either change Drupal's markup or use Mixins.

But there is a module that can help you display components (and some plugins) within a View; and it's called Views Bootstrap.

The module allows you to use components and CSS styles directly from the Views edit page without overriding templates or creating mixins.

In this tutorial, I'll show you how to create a "Recent articles" block using Views and the Media object component.

On a community website, it's a good idea to send some type of follow-up email a week or month after a user registers. This email can be used to ask for feedback or promote useful features.

This type of functionality can be built in a few ways. You could use a 3rd party email service like MailChimp or AWeber to send the follow-up as an auto-responder.

Another possibility, is to send the follow-up email directly from Drupal.

In this tutorial, I'll show you how to use Rules Scheduler (part of Rules) to send a follow-up email one week after a user registers.

Now, every website is different and you may want to send this email after three days or one month. By using Rules, you can adjust this type of configuration directly from Drupal without writing any custom code.

Pages

Subscribe to RSS - Planet Drupal