Enhancing CKEditor in Drupal with AI Module

Image
Drupal with AI
1 m

AI is revolutionizing how we create, manage, and optimize digital experiences, and Drupal is no exception. By combining Drupal with AI, content creation becomes faster, smarter, and more efficient. The AI module in Drupal seamlessly integrates AI capabilities, enhancing CKEditor with advanced features like automated content generation, translation, and summarization.

Why Drupal with AI in CKEditor?

If you watched the Driesnote, you’ve seen how AI simplifies content writing and management. You can generate entire articles with a single command and effortlessly translate or summarize them. This guide walks you through enhancing CKEditor with AI capabilities in Drupal.

Prerequisites

To integrate AI into CKEditor, install and enable the following Drupal modules:

1. AI (Artificial Intelligence) Module: Acts as the core AI integration layer, providing APIs for content generation, translation, and summarization.

2. AI Agents Module: Extends the AI module by enabling AI-driven workflows for content writing, moderation, and recommendations.

3. Key Module: Securely stores API keys and credentials within Drupal, ensuring safe AI service authentication.

4. Gemini Provider Module: Integrates Google's Gemini AI services for advanced content generation and translation. Drupal also supports other AI providers, so choose one that suits your needs.

Configuring the AI Provider

For this guide, we use Gemini from Google, but you can configure any AI provider of your choice.

Step 1: Obtain a Gemini API Key
  1. Go to Google AI Studio.
  2. Sign in with your Google account.
  3. Navigate to the API section and generate a new API key.
  4. Copy the API key for later use.
Step 2: Set Up the API Key in Drupal
  1. Go to Configuration > System > Keys in the Drupal admin panel.
  2. Click Add Key and enter:
    • Key Name: gemini_api_key
    • Key Provider: Configuration
    • Key Value: Paste the copied API key.
  3. Save the configuration.
Step 3: Configure AI Module to Use Gemini
  1. Navigate to Configuration > AI Settings > Provider Settings.
  2. Select Gemini Authentication.
  3. In the API Key field, choose gemini_api_key from the Key module.
  4. Navigate to the model selection settings and choose the version that best fits your needs.
  5. Adjust additional preferences such as temperature (randomness) and response length if available.
  6. Save the settings.
Step 4: Enable AI in CKEditor
  1. Go to Configuration > Content Authoring > Text Formats and Editors.
  2. Select the text format used by CKEditor (e.g., Full HTML or Filtered HTML).
  3. Under CKEditor Plugin Settings, enable AI-related features   Drupal with AI icon   and select the preferred AI model for content assistance.

     CKEditor Drupal with AI settings

  4. Save the configuration.

Testing AI in CKEditor

Now that AI is enabled in CKEditor, let’s test it:

  1. Navigate to Content and create a new article or edit an existing one.
  2. In the CKEditor text area, enter your content manually or use AI-powered features.
  3. Try generating a short article using AI by entering a prompt. Here I generated a small paragraph using AI tool.

    Drupal with AI tools

    Drupal with AI text generatin test

  4. Modify or expand the generated text as needed.

Conclusion

With AI integrated into CKEditor, content creation becomes more intuitive and efficient. By leveraging AI-powered features, Drupal users can enhance productivity, improve content quality, and streamline their workflows. Whether generating new content, translating text, or summarizing articles, AI brings a new level of automation and intelligence to CKEditor.

Looking For Professional Web Design & Development Services?

Our innovative approach blends aesthetics and functionality, creating bespoke online experiences that resonate. We tailor every pixel to showcase your uniqueness. 

Coders Employee
Manar Olimat
Drupal developer
A self motivated and organized software engineer & collaborative team player with positive attitude.

Share

LinkedInFacebookX-Twitter

Stay Updated! 

Keep me updated about new technologies, design trends, business solutions and special offers.

By subscribing to this newsletter, you agree to receive emails and allow your email to be stored