Behind the Scenes of Our Custom Drupal Systems

Behind the Scenes of Our Custom Drupal Systems

Behind the Scenes of Our Custom Drupal Systems
Anandaakrishnan G A
14 April, 2025

Go behind the scenes of how we build 100% custom Drupal 10 systems using structured content types, tailored fields, reusable components, and clean editorial workflows. From entity types to field-level permissions and API endpoints — this guide includes real PHP code, YAML configs, and our exact approach for building scalable, enterprise-ready Drupal platforms.

Behind the Scenes of Our Custom Drupal Systems: Fields, Entities, Workflows — 100% Tailored

Every project is different — and at Arudhra IT Techs, we never use one-size-fits-all. We build 100% tailored Drupal 10 systems using a combination of custom fields, content entities, user roles, editorial workflows, and integrations. In this post, we’ll walk you through our real development workflow — with working PHP code and site-building logic.

🧱 Step 1: Plan Custom Content Types & Fields

For every Drupal project, we first define clear content architecture. For example, in a real estate portal:

  • Property (Node): Title, Location, Price, Type
  • Agent (Custom entity): Name, Contact, Assigned Listings
  • Review (Paragraph): Star rating, comment, created date

We create these using both the UI and custom install files. Example:


# config/install/field.storage.node.field_price.yml
field_name: field_price
entity_type: node
type: decimal
settings:
  precision: 10
  scale: 2
cardinality: 1
translatable: TRUE
    

This gives us a structured, reusable price field for all content types that need it.

🧠 Step 2: Create Custom Content Entities

When node types aren't enough, we build custom content entities. Example: an internal “Agent” entity not tied to the node system:


// my_module/src/Entity/Agent.php
namespace Drupal\my_module\Entity;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
class Agent extends ContentEntityBase {
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields['name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Agent Name'))
      ->setRequired(TRUE);
    $fields['email'] = BaseFieldDefinition::create('email')
      ->setLabel(t('Email'))
      ->setRequired(TRUE);
    return $fields;
  }
}
    

Now you can manage agents independently, with their own admin menu, permissions, and workflows.

🔁 Step 3: Custom Workflows with Moderation

We use the Content Moderation and Workflows modules to build real editorial flows. Example use cases:

  • 📝 Draft → Review → Approved → Published
  • ⛔ Vendor-submitted content needs approval
  • ✅ Admin can bypass moderation with a permission override

Workflows are config-exportable, and we enforce strict permission checks using:


# config/install/workflow.workflow.property_approval.yml
type: content_moderation
states:
  draft:
    label: Draft
  review:
    label: Needs Review
  published:
    label: Published
transitions:
  submit_review:
    from: ['draft']
    to: 'review'
  publish:
    from: ['review']
    to: 'published'
    

⚙️ Step 4: Dynamic Field Permissions & Role-Based Access

We often use Field Permissions module + custom roles for granular access. Example:

  • Vendor can only edit field_price and field_description
  • Admin can edit everything
  • Reviewer role sees read-only fields for moderation

We also apply field-level access with this:


$form['field_secret_notes']['#access'] = \Drupal::currentUser()->hasPermission('edit secret notes');
    

🔌 Step 5: API & JSON Integration

Most of our custom Drupal systems connect with external tools — mobile apps, CRMs, or dashboards — using:

  • 📡 JSON:API or REST Export
  • 🔐 OAuth2 or basic token auth (via Authorization: Bearer)
  • ⚙️ Custom controller endpoints for special data needs

// Route: /api/agent-stats
public function getStats() {
  $count = \Drupal::entityTypeManager()->getStorage('agent')->getQuery()->count()->execute();
  return new JsonResponse(['total_agents' => $count]);
}
    

📋 Step 6: Admin UX, Views & Dashboards

We use Views, exposed filters, and blocks to create admin dashboards that are:

  • 🎯 Role-specific (e.g. “Vendor Dashboard”)
  • 📊 Charts, tables, graphs with Views and Chart.js
  • ⚡ Fast loading, AJAX-filtered data

🎯 Real Example: Vendor Platform

We built a vendor portal where:

  • 🔐 Vendors log in and manage their own nodes
  • 🧾 Custom dashboards show active deals and payouts
  • 📤 AJAX forms let them upload documents and KYC
  • 🕵️ Admins moderate listings via workflows

100% built using Drupal — no external frameworks, no third-party templates.

Final Word: Drupal Is Limitless — If You Build It Right

From custom entities to complex workflows to field-level access and API-ready endpoints — we don’t use Drupal like a CMS. We use it like a **full platform builder**. If you're planning a platform, portal, or structured web app — our custom Drupal systems will get you there.

Let us build your next Drupal system — the tailored, scalable way 👇

Book a Free Drupal Architecture Call