
Enhancing CKEditor in Drupal with AI Module

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
- Go to Google AI Studio.
- Sign in with your Google account.
- Navigate to the API section and generate a new API key.
- Copy the API key for later use.
Step 2: Set Up the API Key in Drupal
- Go to Configuration > System > Keys in the Drupal admin panel.
- Click Add Key and enter:
- Key Name: gemini_api_key
- Key Provider: Configuration
- Key Value: Paste the copied API key.
- Save the configuration.
Step 3: Configure AI Module to Use Gemini
- Navigate to Configuration > AI Settings > Provider Settings.
- Select Gemini Authentication.
- In the API Key field, choose gemini_api_key from the Key module.
- Navigate to the model selection settings and choose the version that best fits your needs.
- Adjust additional preferences such as temperature (randomness) and response length if available.
- Save the settings.
Step 4: Enable AI in CKEditor
- Go to Configuration > Content Authoring > Text Formats and Editors.
- Select the text format used by CKEditor (e.g., Full HTML or Filtered HTML).
Under CKEditor Plugin Settings, enable AI-related features
and select the preferred AI model for content assistance.
- Save the configuration.
Testing AI in CKEditor
Now that AI is enabled in CKEditor, let’s test it:
- Navigate to Content and create a new article or edit an existing one.
- In the CKEditor text area, enter your content manually or use AI-powered features.
Try generating a short article using AI by entering a prompt. Here I generated a small paragraph using AI tool.
- 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.
