{"id":16125214,"url":"https://github.com/bdbch/statamic-components-modifier","last_synced_at":"2025-04-06T12:30:22.088Z","repository":{"id":62492479,"uuid":"381176873","full_name":"bdbch/statamic-components-modifier","owner":"bdbch","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-28T22:34:28.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T18:22:11.858Z","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/bdbch.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}},"created_at":"2021-06-28T22:34:18.000Z","updated_at":"2021-06-28T22:37:19.000Z","dependencies_parsed_at":"2022-11-02T11:31:00.280Z","dependency_job_id":null,"html_url":"https://github.com/bdbch/statamic-components-modifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fstatamic-components-modifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fstatamic-components-modifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fstatamic-components-modifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdbch%2Fstatamic-components-modifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdbch","download_url":"https://codeload.github.com/bdbch/statamic-components-modifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247483793,"owners_count":20946298,"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":[],"created_at":"2024-10-09T21:26:28.896Z","updated_at":"2025-04-06T12:30:22.013Z","avatar_url":"https://github.com/bdbch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# components-modifier\n\n\u003e A simple components loader \u0026 renderer for Statamic\n\n# Installation\n\nInstall this plugin via running `composer require bdbch/statamic-components`. This will install the plugin into your Statamic project. After that,\nmake sure to enable the plugin in the Statamic Control Panel.\n\n# Usage\n\n## Step 1:\nYou will need to setup components for example as a fieldset to make it reusable for different types of content.\n\n## Step 2:\nCreate a replicator field with whatever name you want. This is the replicator field from our example\n\n```yaml\nfields:\n  -\n    handle: page_components\n    field:\n      collapse: true\n      sets:\n        // your replicator sets will be added here\n      display: Components\n      type: replicator\n      icon: replicator\n      listable: hidden\n```\n\n## Step 3:\nCreate sets in your replicator containing fields. The set name will be used for the folder structure so keep this in mind. \n\nFor this example I will create a component with a wysiwyg block \u0026 a image upload. This could be our yaml after this step:\n\n```yaml\nfields:\n  -\n    handle: page_components\n    field:\n      collapse: true\n      sets:\n        textblock_with_image:\n          display: 'Textblock with Image'\n          fields:\n            -\n              handle: content\n              field:\n                always_show_set_button: false\n                buttons:\n                  - h2\n                  - h3\n                  - bold\n                  - italic\n                  - unorderedlist\n                  - orderedlist\n                  - removeformat\n                  - quote\n                  - anchor\n                  - image\n                  - table\n                save_html: false\n                toolbar_mode: fixed\n                link_noopener: false\n                link_noreferrer: false\n                target_blank: false\n                reading_time: false\n                fullscreen: true\n                allow_source: true\n                enable_input_rules: true\n                enable_paste_rules: true\n                display: Content\n                type: bard\n                icon: bard\n                listable: hidden\n                validate:\n                  - required\n            -\n              handle: image\n              field:\n                mode: list\n                container: assets\n                restrict: false\n                allow_uploads: true\n                max_files: 1\n                display: Image\n                type: assets\n                icon: assets\n                listable: hidden\n                validate:\n                  - required\n                  - image\n      display: Components\n      type: replicator\n      icon: replicator\n      listable: hidden\n```\n\n## Step 4:\nNow we need to create the antlers template. **This currently only supports antlers, if you need a different rendering solution please create an issue or submit your pullrequest**.\n\nTo create a template, create a `components` folder in your `/resources/views` directory. Inside `/resources/views/components` you now have to create a folder called the same as your set name, for this example `textblock_with_image`. The final path would be `/resources/views/textblock_with_image`. Inside this directory, create an `index.antlers.html`. This template will now be loaded whenever this set type is used.\n\nInside this template, all fields from your set will be available to use.\n\n## Step 5:\nNow render your components at any place you want via using `{{ page_components | components }}`. This will render the replicator field `page_components` with the specified antlers template.\n\n# Plans\n\n* Rendering via Blade\n* Allow nested component directories for nested components","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbch%2Fstatamic-components-modifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdbch%2Fstatamic-components-modifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdbch%2Fstatamic-components-modifier/lists"}