textlink
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
@valueand@sanitizedto 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:
- Navigate to any content type's "Manage display" page (
/admin/structure/types/manage/[content-type]/display) - Find a text field you want to convert to links
- Change the formatter dropdown from "Default" to "Configurable URL Link"
- 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
@valuefor original text or@sanitizedfor 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.