PHPackages                             tractorcow/silverstripe-datelink - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tractorcow/silverstripe-datelink

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

tractorcow/silverstripe-datelink
================================

Allows you to add wordpress style year/month URLs to time-sensitive sections of your website

3.1.x-dev(7y ago)92028[1 issues](https://github.com/tractorcow/silverstripe-datelink/issues)[1 PRs](https://github.com/tractorcow/silverstripe-datelink/pulls)BSD-3-ClausePHP

Since Jul 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tractorcow/silverstripe-datelink)[ Packagist](https://packagist.org/packages/tractorcow/silverstripe-datelink)[ RSS](/packages/tractorcow-silverstripe-datelink/feed)WikiDiscussions 3.1 Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

datelink module for Silverstripe
================================

[](#datelink-module-for-silverstripe)

This module allows you to create dated urls, that is, links that have the year and month preceeding the url segment.

This is useful if you want your blog posts, or other date-specific sections of the website, to indicate when they were posted. This follows the same style as wordpress, and other blog applications.

For instance, if you had a blog with urls like

You could turn these links into:

Dated style urls can only be applied to subpages, grouped under common holder pages of a list of specified types.

Credits and Authors
-------------------

[](#credits-and-authors)

- Damian Mooyman -

Requirements
------------

[](#requirements)

- SilverStripe 3.1

Installation Instructions
-------------------------

[](#installation-instructions)

- Extract all files into the 'datelink' folder under your Silverstripe root, or install using composer

```
composer require "tractorcow/silverstripe-datelink": "3.1.*@dev"
```

- Ensure that the assets folder is properly writable. This module will save an xml file under assets/\_datelink and will need write permissions
- Configure the page options. See the [Configuration](#configuration) section.
- Run dev/build in order to generate and cache routes.

The reason for using a cached XML file for storing routing patterns is that database access is not available before routes are initialised. All required parent pages and years are extracted during dev/build to create distinct patterns that silverstripe can use during routing, to prevent clashes between it and the default page routing. These routes are then simply read from the XML file and set in the routing table each page load.

Configuration
-------------

[](#configuration)

See [DateLink.yml](_config/DateLink.yml) for the basic configuration options.

### Class Filter Configuration

[](#class-filter-configuration)

To setup date customised links you should configure the class names of each child and parent relations. The only mandatory property to set is the `DateLink.holder_classes` config property to specify the parent classes of all dated urls.

```
DateLink:
  holder_classes:
    - 'BlogHolder'
```

By default all children of the specified classes will have dated urls applied to them. In order to further filter out these classes an additional filter may be applied, the `DateLink.child_classes` config property.

For example, to filter only 'BlogEntry' pages:

```
DateLink:
  child_classes:
    - 'BlogEntry'
```

### URL Configuration

[](#url-configuration)

You can customise the URL layout using constants, year, month (name/number), day of the month, and even day of the week using the configuration property `DateLink.url_pattern`

```
DateLink:
  url_pattern: '$ParentLink!/$Year!/$Month!/$URLSegment!//$Action/$ID/$OtherID'
```

The following pattern placeholders can be used here:

- $ParentLink! - The parent page URL (mandatory)
- $URLSegment! - The URLSegment of the current page (mandatory)
- $Year! - Year (mandatory)
- $Month! - Month number
- \#$Month! - Month number (leading zeros)
- $MonthName! - Month name (full name)
- $Date! - Day of month
- \#$Date! - Day of month (leading zeros)
- $Weekday! - Day of the week (full name)

All wildcards prior to the '//' must be qualified with a trailing '!'

### Date Configuration

[](#date-configuration)

The field which holds the date for each page can be customised by one of two ways:

- The `DateLink.default_date_field` config option will set the default field. By default this is 'Created'
- Override the `getRouteDate` function in your Page class to return the date value that should be used for that page.

License
-------

[](#license)

Copyright (c) 2013, Damian Mooyman All rights reserved.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- The name of Damian Mooyman may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1786 days

Total

2

Last Release

2894d ago

Major Versions

2.4.x-dev → 3.1.x-dev2018-06-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6a363b2d85dc3e82e73cc9e3a57fc15132920b166c5938ad63a54029b9f94b9?d=identicon)[tractorcow](/maintainers/tractorcow)

---

Top Contributors

[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (6 commits)")[![gherkins](https://avatars.githubusercontent.com/u/824927?v=4)](https://github.com/gherkins "gherkins (3 commits)")

---

Tags

urlsilverstripedate

### Embed Badge

![Health badge](/badges/tractorcow-silverstripe-datelink/health.svg)

```
[![Health](https://phpackages.com/badges/tractorcow-silverstripe-datelink/health.svg)](https://phpackages.com/packages/tractorcow-silverstripe-datelink)
```

###  Alternatives

[dnadesign/silverstripe-datedropdownselectorfield

Select your date values with Dropdown Fields

138.8k](/packages/dnadesign-silverstripe-datedropdownselectorfield)[burnbright/silverstripe-externalurlfield

Provides SilverStripe with a DBField and FormField for handling external URLs.

109.6k1](/packages/burnbright-silverstripe-externalurlfield)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
