{"id":50533068,"url":"https://github.com/umd-lib/umdds-dynamic-components","last_synced_at":"2026-06-03T15:02:02.600Z","repository":{"id":359137795,"uuid":"1243850983","full_name":"umd-lib/umdds-dynamic-components","owner":"umd-lib","description":"Drupal module generating components based on site content using the UMD Libraries Design System theme","archived":false,"fork":false,"pushed_at":"2026-05-20T15:13:45.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T19:27:26.249Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/umd-lib.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":"2026-05-19T18:17:08.000Z","updated_at":"2026-05-20T15:21:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/umd-lib/umdds-dynamic-components","commit_stats":null,"previous_names":["umd-lib/umdds-dynamic-components"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/umd-lib/umdds-dynamic-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumdds-dynamic-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumdds-dynamic-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumdds-dynamic-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumdds-dynamic-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umd-lib","download_url":"https://codeload.github.com/umd-lib/umdds-dynamic-components/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umd-lib%2Fumdds-dynamic-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33870026,"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-03T02:00:06.370Z","response_time":59,"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":[],"created_at":"2026-06-03T15:02:01.830Z","updated_at":"2026-06-03T15:02:02.590Z","avatar_url":"https://github.com/umd-lib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UMD Libraries Dynamic Components Module\n\nThis Drupal module provides configurable blocks that display UMD Libraries\nDesign System components. The first configurable block\nis the **Person Component Block**, which displays person content using the UMD\nLibraries Person web component.\n\n## Features\n\n- **Person Component Block**: Displays Person content with autocomplete search\n- **Autocomplete Search**: Search and select Person content by name\n- **Field Mapping**: Automatically maps Drupal Person content fields to the\nPerson component:\n  - `title` → `person_name`\n  - `field_professional_title` → `person_title`\n  - `field_phone` → `person_phone`\n  - `field_email` → `person_email`\n  - `field_library_department` → `person_department`\n\n## Requirements\n\n- Drupal 10 or higher\n- A \"Person\" content type with the following fields:\n  - `title` (built-in)\n  - `field_professional_title` (text field)\n  - `field_phone` (text field)\n  - `field_email` (email field)\n  - `field_library_department` (text field or entity reference)\n\n## Installation\n\n1. Clone or copy this module to your Drupal modules directory:\n\n   ```bash\n   drupal-modules/umdds_dynamic_components/\n   ```\n\n2. Install the module via Drupal UI or Drush:\n\n   ```bash\n   drush pm:install umdds_dynamic_components\n   ```\n\n## Usage\n\n### Creating a Person Block\n\n1. Go to **Structure \u003e Block Layout** in Drupal\n2. Click \"Place block\" in the region where you want the block\n3. Search for and select \"UMD Libraries Person Component\"\n4. Configure the block:\n   * Enter a block title (optional)\n   * Use the autocomplete field to search and select a Person content item\n   * The autocomplete will filter by person title as you type\n5. Save the configuration\n\n### Field Mapping\n\nWhen a Person node is selected, the block automatically extracts and maps the\nfollowing fields:\n\n| Drupal Field | Component Property |\n|--------------|-------------------|\n| title | person_name |\n| field_professional_title | person_title |\n| field_phone | person_phone |\n| field_email | person_email |\n| field_library_department | person_department |\n\nEmpty fields are omitted from the component output.\n\n## API Endpoints\n\n### Autocomplete Endpoint\n\n* **Route**: `/umdds-dynamic-components/autocomplete/person`\n* **Query Parameter**: `q` (search query)\n* **Returns**: JSON array of matching Person content items\n\nExample:\n\n```bash\nGET /umdds-dynamic-components/autocomplete/person?q=john\n```\n\n## Component Integration\n\nThe module renders the UMD Libraries Person web component using a Twig template.\nThe component expects:\n\n```html\n\u003cumd-libraries-person\n  person-name=\"John Doe\"\n  person-title=\"Librarian\"\n  person-phone=\"301-405-0000\"\n  person-email=\"john@umd.edu\"\n  person-department=\"Reference\"\n\u003e\n\u003c/umd-libraries-person\u003e\n```\n\nFor more information about the UMD Libraries Person component, see:\nhttps://github.com/umd-lib/umdlib-design-system-theme/tree/4.x/components/umd-libraries-person\n\n## Architecture\n\n```\numdds_dynamic_components/\n├── src/\n│   ├── Plugin/Block/\n│   │   └── PersonComponentBlock.php    # Block plugin with form configuration\n│   └── Controller/\n│       └── AutocompleteController.php  # Autocomplete search handler\n├── templates/\n│   └── umdds-person-component.html.twig  # Twig template for component rendering\n├── umdds_dynamic_components.info.yml   # Module metadata\n├── umdds_dynamic_components.module     # Module file with theme hooks\n├── umdds_dynamic_components.routing.yml # Route definitions\n└── README.md                           # This file\n```\n\n## Development Notes\n\n### Adding New Components\n\nTo add additional configurable blocks for other UMD Libraries Design System components:\n\n1. Create a new block plugin in `src/Plugin/Block/`\n2. Add a new autocomplete controller method for searching relevant content\n3. Define routing for the autocomplete endpoint\n4. Create a Twig template for rendering the component\n5. Register the template in `hook_theme()` in the .module file\n\n### Caching\n\nThe block implements proper caching using the `#cache` property with the\nselected node's cache tags. This ensures that the block is invalidated whenever\nthe Person node is updated.\n\n## Troubleshooting\n\n### Block not showing content\n\n* Verify that the Person content type exists\n* Check that at least one Person node is published\n* Ensure the autocomplete field can find Person content\n\n### Autocomplete not working\n\n* Clear the Drupal cache\n* Verify the routing file is properly formatted\n* Check that the route is registered with `drush route:rebuild` or `drush cr`\n\n### Component not rendering\n\n* Verify the UMD Libraries Design System JavaScript is loaded on the page\n* Check browser console for component errors\n* Ensure all required component attributes are set\n\n## License\n\nThis module is part of the UMD Libraries Drupal ecosystem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fumdds-dynamic-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumd-lib%2Fumdds-dynamic-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumd-lib%2Fumdds-dynamic-components/lists"}