Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Text Link

No security coverage
View on drupal.org

TextLink transforms any text field into a clickable link by combining field values with a customizable base URL, offering features like automatic text sanitization and customizable link text. This module is useful for creating social media links, search URLs, or connecting to external services without requiring any custom code.

TextLink transforms any text field into clickable links by combining field values with customizable base URLs. Perfect for creating profile links, search URLs, or any pattern.

Features

Basic Functionality:

  • Converts text field values into clickable links using configurable base URLs
  • Works with any string or text field type in Drupal
  • Provides a field formatter that can be applied to existing fields without structural changes

Unique Features:

  • Flexible URL Construction: Combine any base URL with field values (e.g., https://linkedin.com/in/ + field value)
  • Smart Text Sanitization: Automatically converts "John Doe" to "john-doe" for URL-friendly formats
  • Customizable Link Text: Use placeholders like @value and @sanitized to control link appearance
  • Multiple Separator Options: Choose hyphens, underscores, dots, or remove spaces entirely
  • Target Control: Option to open links in new windows with proper security attributes

When to Use This Module:

  • Social Media Integration: Link usernames to LinkedIn, Twitter, or GitHub profiles
  • Search Functionality: Create search links to external engines or internal systems
  • External Integrations: Link to third-party services, documentation, or APIs
  • Directory Listings: Connect names or IDs to external directory services
  • E-commerce: Link product codes to manufacturer websites or spec sheets

Use Cases:

  • Staff directory linking to LinkedIn profiles
  • Product catalog linking to manufacturer pages
  • Research database linking to external citations
  • Event listings linking to ticket vendors
  • Service directory linking to provider websites

Post-Installation

Getting Started:

  1. Navigate to any content type's "Manage display" page (/admin/structure/types/manage/[content-type]/display)
  2. Find a text field you want to convert to links
  3. Change the formatter dropdown from "Default" to "Configurable URL Link"
  4. Click the gear icon to configure settings

Configuration Options:

  • Base URL: The URL prefix (e.g., https://example.com/user/)
  • Link Text: Display format using @value for original text or @sanitized for cleaned text
  • Auto-sanitize: Enable to clean field values for URL usage
  • Separator: Choose how spaces are handled (hyphens, underscores, dots, or removal)
  • New Window: Control whether links open in new tabs

Example Configuration:

For a "RERA Certificate Number" field:

  • Base URL: https://maharera.maharashtra.gov.in/projects-search-result?certificate_no=
  • Link Text: View @value on Rera
  • Auto-sanitize: Disabled

Result: "P52100030521" becomes a link to https://maharera.maharashtra.gov.in/projects-search-result?certificate_no=P52100030521 displaying "View P52100030521 on Rera"

No Additional Setup Required:

The module works immediately after installation. No new content types, permissions, or complex configurations needed.

Additional Requirements

Drupal Core Requirements:

  • Drupal 10.0+ or Drupal 11.0+
  • PHP 8.1+

Core Module Dependencies:

  • Field module (included in core)
  • Link module (included in core)

No External Dependencies:

This module requires no external libraries, APIs, or third-party services. It works entirely within Drupal's field system.

Similar projects

Linked Field vs TextLink:

  • Linked Field: Linked Field allows you to link fields in the field formatter settings
  • TextLink: Automatically constructs URLs from text values using base URL patterns
  • Use TextLink when: You have consistent URL patterns and want to simplify data entry

Computed Field vs TextLink:

  • Computed Field: Requires PHP code to generate field values
  • TextLink: Provides a user-friendly interface for URL construction
  • Use TextLink when: You need URL generation without custom coding

Token vs TextLink:

  • Token: General-purpose text replacement system
  • TextLink: Specialized for URL construction with field formatters
  • Use TextLink when: You specifically need URL generation for field display

External Link vs TextLink:

  • External Link: Focuses on link validation and external URL handling
  • TextLink: Focuses on URL construction from existing text values
  • Use TextLink when: You're building URLs rather than validating existing ones

Key Differentiator: TextLink is the only module that specializes in transforming existing text field values into properly formatted URLs through an intuitive field formatter interface.

Supporting this Module

Community Contributions:

  • Report issues and feature requests on the project issue queue
  • Submit patches and improvements via merge requests
  • Help with documentation and translations

Activity

Total releases
1
First release
Aug 2025
Latest release
11 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.0.x-dev Dev Aug 6, 2025