Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Creating a social network on Drupal

17/04/2025, by Ivan

Drupal: Pushing the Limits

Drupal is one of the best content management systems (CMS). In fact, it won the 2008 Best Open Source CMS and Best PHP Open Source CMS awards—twice! After about 8 years of development, Drupal has become one of the most powerful and versatile frameworks available. Its incredible flexibility is both its greatest strength... and its greatest weakness. Any functionality is possible—but where do you start? I’ve spent long days exploring various modules, their use cases, compatibility, bugs, and quirks, to confidently recommend what works.

User profile in Drupal

17/04/2025, by Ivan

Profile Page in Drupal

The profile page is the most complex and exciting part of any social network. I hope this will also be an engaging experience for you after reading this article. Drupal offers us several options for implementing user profiles. The first option available as a core module is the Profile module. This module is suitable if you want a very simple profile. But we're talking about a social network.

Drupal 7 - Working with DB via PHP PDO

17/04/2025, by Ivan

With the transition to Drupal 7, we move to the new Drupal DB abstraction layer API, which is built on top of PDO. PDO has long been used in frameworks like Zend, as well as many other PHP frameworks. But everything seemed so convenient in Drupal 6 with writing plain SQL queries — so why do we need something new?

Let’s first understand what PDO is.

Working with Database in Drupal 7 - Lesson 1 - Drupal DB API

17/04/2025, by Ivan

If you’ve written modules for Drupal 6, switching to the new Drupal 7 Database API won’t be too difficult. The new DB API is based on the PHP PDO extension, which gives it the ability to work with various databases like MySQL, PostgreSQL, MSSQL, and potentially Oracle. Whether it’s easier to use is subjective — getting used to the new syntax takes time, and writing SQL queries is still more familiar for many developers.

Here’s a brief excerpt from the official documentation:

Working with a Database in Drupal 7 - Lesson 2 - Database Configuration

17/04/2025, by Ivan

The primary mechanism for defining a database connection in Drupal is the $databases array in settings.php. As the name implies, $databases allows you to define multiple database connections. It also supports defining multiple targets. A connection is not opened (i.e., a connection object is not created) until a piece of code executes a database query for the first time.

Working with a Database in Drupal 7 - Lesson 3 - Static Queries (SELECT)

17/04/2025, by Ivan

The most common form of a query in Drupal is a static query. A static query is passed directly to the database as-is. Only SELECT queries can be static.

Use static queries only for very simple operations. For more complex, dynamically constructed, or modifiable queries, you should use dynamic queries.

The simplest way to execute a static query is via the query method:

<?php $result = $conn->query("SELECT nid, title FROM {node}");
?>

The preferred approach is to use the procedural wrapper:

Working with a Database in Drupal 7 - Lesson 4 - Dynamic Queries (SELECT)

17/04/2025, by Ivan

We’ve now reached perhaps the most exciting part of Drupal’s Database API: dynamic queries. These are called "dynamic" because Drupal appends the query string on the fly. All INSERT, UPDATE, DELETE, or MERGE queries can be dynamic. SELECT queries can be either static or dynamic. However, it is recommended to use dynamic queries even for SELECT operations.