{"id":18750916,"url":"https://github.com/silverstripe/silverstripe-segment-field","last_synced_at":"2026-02-10T04:02:50.356Z","repository":{"id":36212257,"uuid":"40516528","full_name":"silverstripe/silverstripe-segment-field","owner":"silverstripe","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-05T01:19:20.000Z","size":1597,"stargazers_count":7,"open_issues_count":2,"forks_count":15,"subscribers_count":9,"default_branch":"4","last_synced_at":"2026-02-05T14:13:36.509Z","etag":null,"topics":["cms","hacktoberfest","silverstripe"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverstripe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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":"2015-08-11T02:18:29.000Z","updated_at":"2026-02-04T23:17:00.000Z","dependencies_parsed_at":"2024-01-08T02:44:02.710Z","dependency_job_id":"1ba09edc-5b20-4512-a84c-c6494b4a60c5","html_url":"https://github.com/silverstripe/silverstripe-segment-field","commit_stats":{"total_commits":77,"total_committers":12,"mean_commits":6.416666666666667,"dds":0.7272727272727273,"last_synced_commit":"ed1a073cd48ac65acd749851989d6503d8408941"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"purl":"pkg:github/silverstripe/silverstripe-segment-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverstripe%2Fsilverstripe-segment-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverstripe%2Fsilverstripe-segment-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverstripe%2Fsilverstripe-segment-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverstripe%2Fsilverstripe-segment-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverstripe","download_url":"https://codeload.github.com/silverstripe/silverstripe-segment-field/tar.gz/refs/heads/4","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverstripe%2Fsilverstripe-segment-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29290466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T03:42:42.660Z","status":"ssl_error","status_checked_at":"2026-02-10T03:42:41.897Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cms","hacktoberfest","silverstripe"],"created_at":"2024-11-07T17:13:35.181Z","updated_at":"2026-02-10T04:02:50.049Z","avatar_url":"https://github.com/silverstripe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Silverstripe Segment Field\n\n[![CI](https://github.com/silverstripe/silverstripe-segment-field/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-segment-field/actions/workflows/ci.yml)\n[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)\n\nA reusable approach to segment-generating fields.\n\n## Installation\n\n```sh\ncomposer require silverstripe/segment-field\n```\n\n## Usage\n\n```php\nuse SilverStripe\\Forms\\SegmentField;\nuse SilverStripe\\Forms\\SegmentFieldModifier\\SlugSegmentFieldModifier;\nuse SilverStripe\\Forms\\SegmentFieldModifier\\IDSegmentFieldModifier;\n\nSegmentField::create('PageName')-\u003esetModifiers(array(\n    SlugSegmentFieldModifier::create()-\u003esetDefault('page'),\n    array('-', ''),\n    IDSegmentFieldModifier::create(),\n))-\u003esetPreview($this-\u003ePageDisplayName)\n```\n\n1. Starting with a value of `\"My New Page!\"`.\n2. The value is passed through `SlugSegmentFieldModifier`.\n3. Preview value becomes `\"My-New-Page\"`, Input value becomes `\"My-New-Page\"`.\n4. The value is passed through `array('-', '')`.\n5. Preview value becomes `\"My-New-Page-\"`, Input value becomes `\"My-New-Page\"`.\n6. The value is passed through `IDSegmentFieldModifier`.\n7. Preview value becomes `\"My-New-Page-1\"` (with the DataObject ID), Input value becomes `\"My-New-Page\"`.\n\nYou can pass any similarly structured array or implementation of `SilverStripe\\Forms\\SegmentFieldModifier` in the modifiers list.\n\n## Using on the frontend\n\nThis field is primarily designed for use within the Silverstripe CMS. If you want to use it on the frontend, please\nensure that you have included your own version of jQuery and the jQuery entwine library that ships with the\nsilverstripe/admin module, for example:\n\n```php\nRequirements::javascript('//code.jquery.com/jquery-3.3.1.min.js');\nRequirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');\n```\n\nThese dependencies are included by default when using this field within the CMS.\n\n## Versioning\n\nThis library follows [Semver](http://semver.org). According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.\n\nAll methods, with `public` visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep `protected` methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.\n\n## Thanks\n\nI'd like to thank [SilverStripe](http://www.silverstripe.com) for letting me work on fun projects like this. Feel free to talk to me about using the [framework and CMS](http://www.silverstripe.org) or [working at SilverStripe](http://www.silverstripe.com/who-we-are/#careers).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverstripe%2Fsilverstripe-segment-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverstripe%2Fsilverstripe-segment-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverstripe%2Fsilverstripe-segment-field/lists"}