{"id":22610200,"url":"https://github.com/twistedstack/drupal-paragraph-status","last_synced_at":"2025-03-28T23:12:49.663Z","repository":{"id":267107405,"uuid":"900261676","full_name":"twistedstack/drupal-paragraph-status","owner":"twistedstack","description":"Drupal module for handling status codes in a paragraph component. ","archived":false,"fork":false,"pushed_at":"2024-12-08T11:41:23.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T09:43:28.891Z","etag":null,"topics":["component","drupal","paragraph"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twistedstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-08T10:16:48.000Z","updated_at":"2024-12-27T18:34:51.000Z","dependencies_parsed_at":"2024-12-08T12:25:04.568Z","dependency_job_id":"50786290-c5d5-400a-bd53-1a3c711c1051","html_url":"https://github.com/twistedstack/drupal-paragraph-status","commit_stats":null,"previous_names":["twistedstack/drupal-paragraph-status"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twistedstack%2Fdrupal-paragraph-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twistedstack%2Fdrupal-paragraph-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twistedstack%2Fdrupal-paragraph-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twistedstack%2Fdrupal-paragraph-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twistedstack","download_url":"https://codeload.github.com/twistedstack/drupal-paragraph-status/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112671,"owners_count":20725301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["component","drupal","paragraph"],"created_at":"2024-12-08T16:06:13.472Z","updated_at":"2025-03-28T23:12:49.626Z","avatar_url":"https://github.com/twistedstack.png","language":"PHP","readme":"# drupal-paragraph-status\n\nDrupal module for handling status codes in a paragraph component.\n\n**Status:** `still developing`\n\nDrupal module that shows a particular paragraph field based on the node path.\n\n\n\n### Explanation of the Code\n\n1. **Path Matching Logic**:\n   - The `PathMatcher` service is used to determine which paragraphs to display based on the current path.\n\n2. **Field Filtering**:\n   - The code checks if the node has the paragraph field and retrieves referenced paragraphs.\n   - Depending on the path, it filters or modifies the paragraphs before rendering.\n\n3. **Rendering Paragraphs**:\n   - The `entityTypeManager`'s `viewBuilder` is used to render the filtered paragraphs in the desired view mode.\n\n---\n\n### Enable the Module\n\n1. Place the module in the `modules/custom` directory.\n2. Enable it using Drush or the admin UI:\n\n```bash\ndrush en custom_paragraph_display\ndrush cr\n```\n\n---\n\n### Test the Module\n\n1. Create or edit a node with the specified paragraph field (`field_paragraph_content`).\n2. Visit the node's path (e.g., `/special-path` or `/another-path/some-page`).\n3. Verify that the correct paragraph(s) are displayed based on the current path.\n\n---\n\nThis approach dynamically alters the rendering of the paragraph field based on the current path, offering a flexible and scalable solution.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwistedstack%2Fdrupal-paragraph-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwistedstack%2Fdrupal-paragraph-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwistedstack%2Fdrupal-paragraph-status/lists"}