{"id":51099419,"url":"https://github.com/santoshtmp/drupal-custom-helperbox","last_synced_at":"2026-06-24T09:34:47.041Z","repository":{"id":327948237,"uuid":"1106598680","full_name":"santoshtmp/drupal-custom-helperbox","owner":"santoshtmp","description":"Drupal custom helper module box.","archived":false,"fork":false,"pushed_at":"2026-05-23T08:31:54.000Z","size":223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T09:34:45.389Z","etag":null,"topics":["drupal","drupal-module","helperbox","module"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santoshtmp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-29T15:12:18.000Z","updated_at":"2026-05-23T08:31:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/santoshtmp/drupal-custom-helperbox","commit_stats":null,"previous_names":["santoshtmp/helperbox","santoshtmp/drupal-custom-helperbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/santoshtmp/drupal-custom-helperbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santoshtmp%2Fdrupal-custom-helperbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santoshtmp%2Fdrupal-custom-helperbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santoshtmp%2Fdrupal-custom-helperbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santoshtmp%2Fdrupal-custom-helperbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santoshtmp","download_url":"https://codeload.github.com/santoshtmp/drupal-custom-helperbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santoshtmp%2Fdrupal-custom-helperbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34724746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","drupal-module","helperbox","module"],"created_at":"2026-06-24T09:34:46.312Z","updated_at":"2026-06-24T09:34:47.035Z","avatar_url":"https://github.com/santoshtmp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HelperBox Drupal Module\n\nHelperBox is a comprehensive custom Drupal module that delivers a broad collection of features to support and extend site development. It includes helper functions, custom blocks, Views fields, field formatters, date/time widgets, APIs, theme template suggestions, preprocess hooks, form field access controls, and various utility hooks.\n\n**Maintainer:** santoshtmp7@gmail.com  \n**Version:** 11.3.1  \n**Drupal Compatibility:** Drupal 11+  \n**Package:** Custom\n\n## Module Structure\n\n```\nhelperbox/\n├── config/\n│   ├── install/\n│   │   └── helperbox.settings.yml       # Default module configuration\n│   └── schema/\n│       └── helperbox.schema.yml         # Configuration schema definitions\n├── css/\n│   ├── helperbox.css                    # Frontend styles\n│   ├── helperbox_admin.css              # Admin interface styles\n│   └── helperbox_datetimewidget.css     # Date/time widget styles\n├── includes/\n│   ├── helperbox.preprocess.inc         # Preprocess hooks (node, paragraph, views)\n│   ├── helperbox.entity.inc             # Entity hooks\n│   ├── helperbox.form.inc               # Form hooks and alterations\n│   ├── helperbox.menu.inc               # Menu hooks\n│   ├── helperbox.page.inc               # Page hooks\n│   ├── helperbox.theme.inc              # Theme hooks and template suggestions\n│   └── helperbox.views.inc              # Views hooks\n├── js/\n│   ├── helperbox.js                     # Frontend JavaScript\n│   ├── helperbox_admin.js               # Admin JavaScript\n│   ├── helperbox_datetimewidget.js      # Date/time widget JavaScript\n│   └── node_form_conditional_fields.js  # Conditional field logic\n├── src/\n│   ├── Controller/\n│   │   └── TestApiController.php        # API endpoint controller\n│   ├── EventSubscriber/\n│   │   └── LoaderEventSubscriber.php    # Page load event subscriber\n│   ├── Form/\n│   │   └── HelperboxSettingsForm.php    # Module settings form\n│   ├── Helper/\n│   │   ├── FormField.php                # Form field utilities\n│   │   ├── GetBlock.php                 # Block retrieval helpers\n│   │   ├── HelperboxSettings.php        # Settings helper class\n│   │   ├── MediaHelper.php              # Media handling utilities\n│   │   ├── MenuHelper.php               # Menu building helpers\n│   │   ├── PartialsContent.php          # Content partial helpers\n│   │   ├── PreprocessNode.php           # Node preprocess utilities\n│   │   ├── PreprocessViewsViewField.php # Views field preprocess\n│   │   ├── QueryNode.php                # Node query helpers\n│   │   └── UtilHelper.php               # General utilities\n│   └── Plugin/\n│       ├── Block/\n│       │   ├── BannerBlock.php          # Banner block plugin\n│       │   ├── ContactBlock.php         # Contact block plugin\n│       │   ├── ContentTypeBlock.php     # Content type block plugin\n│       │   ├── MenuBlock.php            # Menu block plugin\n│       │   └── RepeatedContentBlock.php # Repeated content block plugin\n│       ├── Field/\n│       │   ├── FieldFormatter/\n│       │   │   ├── DateRangeFormat.php         # Date range formatter\n│       │   │   ├── MediaInfoEntityReferenceFormatter.php  # Media info formatter\n│       │   │   └── TelPhoneNumFormatter.php      # Phone number formatter\n│       │   └── FieldWidget/\n│       │       └── DateTimeHelperboxWidget.php   # Custom date/time widget\n│       └── views/\n│           ├── field/\n│           │   ├── AddCTA.php             # CTA button field\n│           │   ├── AddMedia.php           # Media adder field\n│           │   ├── CountNode.php          # Node counter field\n│           │   ├── CustomText.php         # Custom HTML text field\n│           │   └── RenderBlock.php        # Block renderer field\n│           └── area/\n│               └── RenderBlock.php        # Block renderer area handler\n├── templates/\n│   ├── helperbox-add-cta.html.twig        # CTA button template\n│   ├── helperbox-banner.html.twig         # Banner block template\n│   ├── helperbox-contact.html.twig        # Contact block template\n│   ├── helperbox-content.html.twig        # Content block template\n│   ├── helperbox-date-time-widget.html.twig  # Date/time widget template\n│   ├── helperbox-menu.html.twig           # Menu block template\n│   ├── helperbox-renderblock.html.twig    # Render block template\n│   ├── helperbox-repeatedcontent.html.twig   # Repeated content template\n│   └── macro/\n│       ├── menuitems.html.twig            # Menu items macro\n│       ├── render_field_content_nodes.html.twig  # Field render macro\n│       ├── render_field_taxonomy_terms.html.twig # Taxonomy terms macro\n│       └── social_links.html.twig         # Social links macro\n├── helperbox.info.yml                     # Module info file\n├── helperbox.install                      # Install/uninstall hooks\n├── helperbox.libraries.yml                # Asset libraries definition\n├── helperbox.links.contextual.yml         # Contextual links\n├── helperbox.links.menu.yml               # Menu links\n├── helperbox.module                       # Main module file\n├── helperbox.routing.yml                  # Route definitions\n├── helperbox.services.yml                 # Service definitions\n├── images/\n│   └── Thumbnail.webp                     # Default thumbnail image\n└── readme.md                              # This file\n```\n\n## Features Overview\n\n### 1. Template Suggestions System\n- Provides template suggestions for forms, paragraphs, fields, colorbox_view_mode_formatter, and other components\n- Advanced suggestions for specific content types, nodes, and view contexts\n- Custom theme implementations for various components\n\n### 2. Custom Views Fields\n- **Node Counter (`helperbox_count_node`)**: Counts nodes based on content type and conditions\n- **Block Renderer (`helperbox_renderblock`)**: Renders blocks and views blocks within Views\n- **Custom HTML Text (`helperbox_custom_text`)**: Displays full HTML content with token support\n- **Media Adder (`helperbox_add_media`)**: Adds media to views with advanced options\n- **CTA Button (`helperbox_add_cta`)**: Configurable call-to-action buttons with support for:\n  - Internal paths, external URLs, and entity references\n  - Primary/secondary button styles\n  - Dynamic query parameters with placeholders\n  - Link field integration\n\n### 3. Custom Field Formatters\n- **Phone Number Formatter (`helperbox_fieldformat_telphone`)**: Formats text fields as clickable phone links\n- **Media Information Formatter (`helperbox_fieldformat_mediainfo`)**: Displays media file information (size, type, extension, download links)\n- **Date Range Formatter (`helperbox_fieldformat_daterange`)**: Custom date range formatting options\n\n### 4. Advanced Date/Time Widgets\n- **Custom Date Time Widget (`helperbox_date_time_widget`)**: Enhanced date/time input with flexible configurations\n  - Multiple date order options (YMD, MDY, DMY, YM, MY, Y, M, YMopt)\n  - Customizable year ranges (past/future)\n  - Time type options (12/24 hour)\n  - Optional month selection for year/month combinations\n\n### 5. Custom Blocks\n- **Banner Block (`helperbox_banner_block`)**: Feature-rich banner with multiple layout options, media support, CTAs, and highlights\n- **Contact Block (`helperbox_contact_block`)**: Contact information with social links, webforms, and media\n- **Content Block (`helperbox_content_type_block`)**: Dynamic content display with view options\n- **Menu Block (`helperbox_menu_block`)**: Custom menu rendering with social links\n- **Repeated Content Block (`helperbox_repeated_content_block`)**: Reusable content sections\n\n### 6. Media Handling Features\n- Custom media thumbnail updates via `field_custom_thumbnail`\n- Media library information helper with file details\n- Image style integration\n- File size conversion utilities\n\n### 7. Form Field Access Controls\n- Configurable field access based on content type and bundle\n- Node-specific field access rules\n- Form ID-based field access controls\n- Maximum node limits per content type\n- Field validation (title uniqueness, country code uniqueness)\n\n### 8. Theme System Enhancements\n- Custom theme implementations for various components\n- Template suggestions for paragraphs based on context\n- Field template suggestions\n- View mode formatter suggestions\n\n### 9. Utility Functions\n- Error logging with backtrace\n- Byte-to-size conversion utilities\n- Content type retrieval helpers\n- Block rendering utilities\n- Media information extraction\n\n### 10. API Integration\n- Custom API endpoint at `/api/testhelperbox`\n- JSON response capabilities\n- Integration with Config Pages module\n\n### 11. Preprocessing Hooks\n- Node preprocessing with content-type-specific methods\n- Paragraph preprocessing with view context\n- Views field preprocessing\n- Language block preprocessing\n\n### 12. Configuration Management\n- Settings form at `/admin/config/development/customhelperbox`\n- Enable media custom thumbnail settings\n- Custom field access rules configuration\n- Node validation rules\n\n## Installation\n\n1. Place the helperbox module in your Drupal installation's modules directory:\n   ```bash\n   # Module should be at: web/modules/custom/helperbox\n   ```\n\n2. Enable the module via admin interface or Drush:\n   ```bash\n   drush en helperbox -y\n   ```\n\n3. Configure settings at `/admin/config/development/customhelperbox`\n\n4. Clear caches:\n   ```bash\n   drush cr\n   ```\n\n## Dependencies\n\n### Drupal Core Modules\n- `system`\n- `block`\n- `field`\n- `datetime`\n\n### Contributed Modules\n- `select2` - Enhanced select form elements\n- `media_library_form_element` - Media library form widget\n- `menu_item_extras` - Extended menu item features\n- `config_pages` - Configurable page entities\n- `conditional_fields` - Conditional form field logic\n\n## Configuration\n\nThe module provides extensive configuration options accessible at `/admin/config/development/customhelperbox`:\n\n- **Enable Helperbox**: Toggle module features\n- **Enable custom media thumbnail**: Allow custom media thumbnails via `field_custom_thumbnail`\n- **CDN Configuration**: Enable/disable CDN for Select2 and lightGallery libraries\n- **Field Access Rules**: Configure field access based on content type and bundle\n- **Maximum Node Limits**: Set node count limits per content type\n- **Validation Rules**: Configure title and country code uniqueness validation\n\n## Routes and Paths\n\n| Route Name | Path | Description |\n|------------|------|-------------|\n| `helperbox.settings` | `/admin/config/development/customhelperbox` | Module settings form |\n| `helperbox.api_test` | `/api/testhelperbox` | Test API endpoint (JSON) |\n\n## Services\n\n| Service ID | Class | Description |\n|------------|-------|-------------|\n| `helperbox.loader_event_subscriber` | `Drupal\\helperbox\\EventSubscriber\\LoaderEventSubscriber` | Event subscriber for page load events |\n\n## Usage Examples\n\n### Using Custom Views Fields\n\n1. Create a new View or edit an existing one\n2. Add a field and select from HelperBox custom fields:\n   - **CTA Button**: Add configurable call-to-action buttons\n   - **Node Counter**: Display node counts with conditions\n   - **Block Renderer**: Render blocks within Views\n   - **Custom HTML Text**: Display formatted HTML content\n   - **Media Adder**: Add media elements to Views\n3. Configure the field options as needed\n\n### Using Custom Blocks\n\n1. Navigate to **Structure \u003e Block Layout**\n2. Click **Place Block** in your desired region\n3. Select a HelperBox block under the **Custom** category\n4. Configure the block settings:\n   - Banner Block: Add titles, body, CTAs, media, and highlights\n   - Contact Block: Configure contact info, social links, and webforms\n   - Content Block: Select content types and display options\n   - Menu Block: Configure menu layout and social links\n   - Repeated Content Block: Add reusable content sections\n5. Save and place the block\n\n### Using Custom Field Formatters\n\n1. Navigate to **Structure \u003e Content Types** and edit a content type\n2. Go to the **Manage Display** tab\n3. For a field, select a HelperBox formatter:\n   - **Phone Number Formatter**: For clickable phone links\n   - **Media Information Formatter**: For file details display\n   - **Date Range Formatter**: For custom date formatting\n4. Adjust formatter settings as needed\n5. Save the display settings\n\n### Using the Date/Time Widget\n\n1. Create or edit a datetime field on a content type\n2. In **Manage Form Display**, select **Helperbox Date Time Widget**\n3. Configure widget settings:\n   - Date order (YMD, MDY, DMY, etc.)\n   - Time type (12/24 hour)\n   - Year range\n   - Optional time selection\n4. Save the form display settings\n\n## Development Notes\n\nThis module implements numerous Drupal hooks and follows Drupal coding standards. It includes extensive error handling and logging capabilities.\n\n### Key Hooks Implemented\n\n- `hook_theme()` - Custom theme implementations\n- `hook_preprocess_*()` - Template preprocessing\n- `hook_form_*_alter()` - Form alterations\n- `hook_entity_*()` - Entity hooks\n- `hook_views_*()` - Views hooks\n- `hook_menu_link_alter()` - Menu alterations\n\n### Coding Standards\n\n- Follows Drupal 11 coding standards\n- Uses PHP 8+ features where appropriate\n- Implements proper type hinting and return types\n- Uses Drupal's dependency injection where applicable\n\n## Troubleshooting\n\n### Schema Errors\n\nIf you encounter schema errors after updating the module:\n\n```bash\n# Clear caches\ndrush cr\n\n# Re-import configuration\ndrush config-import -y\n```\n\n### Configuration Issues\n\nTo reset module settings:\n\n```bash\n# Delete module configuration\ndrush config-delete helperbox.settings -y\n\n# Re-import from install directory\ndrush config-import -y\n```\n\n## References\n\n1. https://www.drupal.org/documentation\n2. https://drupalize.me/\n3. https://www.drupal.org/docs/creating-modules/creating-custom-blocks/create-a-custom-block-plugin\n4. https://www.drupal.org/docs/user_guide/en/block-create-custom.html\n5. https://www.drupal.org/project/media_library_form_element\n6. https://drupal.stackexchange.com/questions/267317/how-can-i-use-a-media-field-in-a-custom-form\n7. https://www.drupal.org/docs/drupal-apis/form-api/conditional-form-fields\n8. https://www.drupal.org/docs/develop/drupal-apis/javascript-api/ajax-forms\n9. https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21theme.api.php/function/hook_preprocess_HOOK/10\n10. https://www.youtube.com/@WebWash\n11. https://drupalize.me/tutorial/concept-entity-queries\n\n## Changelog\n\n### Version 11.3.1\n- Added `helperbox_add_cta` Views field plugin\n- Updated schema definitions for all Views fields\n- Improved CTA button with dynamic query parameters\n- Added entity autocomplete for CTA links\n- Fixed configuration schema warnings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantoshtmp%2Fdrupal-custom-helperbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantoshtmp%2Fdrupal-custom-helperbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantoshtmp%2Fdrupal-custom-helperbox/lists"}