PHPackages                             andrewhaine/silverstripe-sitetree-inheritance-helpers - 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. andrewhaine/silverstripe-sitetree-inheritance-helpers

ActiveSilverstripe-vendormodule

andrewhaine/silverstripe-sitetree-inheritance-helpers
=====================================================

A SilverStripe module that adds some helper methods to your site tree to aid with inherited values and relations

138PHP

Since Apr 23Pushed 8y ago2 watchersCompare

[ Source](https://github.com/AndrewHaine/silverstripe-sitetree-inheritance-helpers)[ Packagist](https://packagist.org/packages/andrewhaine/silverstripe-sitetree-inheritance-helpers)[ RSS](/packages/andrewhaine-silverstripe-sitetree-inheritance-helpers/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SilverStripe SiteTree Inheritance Helpers
=========================================

[](#silverstripe-sitetree-inheritance-helpers)

A module which adds some additional methods to SiteTree to make it easier to search "up" the page tree for values or relations to inherit. Please note this module is only compatible with SilverStripe 4.1+.

The problem
-----------

[](#the-problem)

Are you tired of writing methods or template loops to retrieve database values or relations from parent pages? Well this is just the module for you!

Introducing the helper methods
------------------------------

[](#introducing-the-helper-methods)

Currently this module adds two methods to help with inherited values. These can be used within your Page's php class *or* from within a template file.

### Getting database field values

[](#getting-database-field-values)

If you just need a database value you can use `getInheritedDBValue`

#### Examples

[](#examples)

**CustomPage.php**

```
public function getMyDataBaseValue()
{
    return $this->getInheritedDBValue('FieldName');
}
```

**CustomPage.ss**

```
{$getInheritedDBValue('FieldName')}
```

### Getting relation values

[](#getting-relation-values)

If you need to get a relation from a parent page, for example a `$has_one` or a `$many_many` you can use `getInheritedRelationValue`. This method has an additional parameter which will need to be set to true when the relation is a list.

#### Examples

[](#examples-1)

**CustomPage.php**

```
public function getMyInheritedList()
{
    return $this->getInheritedRelationValue('SomeList', true);
}
```

**CustomPage.ss**

```

    \\\

```

Issues &amp; Contributing
-------------------------

[](#issues--contributing)

This was made quite quickly, any issue reports or enhancements are welcome :) - See you in the issues section

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/86bf4d3dfe55597dfe041bd97488d830a42582e3224f12ad8a002066587d42e6?d=identicon)[andrewhaine](/maintainers/andrewhaine)

---

Top Contributors

[![AndrewHaine](https://avatars.githubusercontent.com/u/16389134?v=4)](https://github.com/AndrewHaine "AndrewHaine (1 commits)")

### Embed Badge

![Health badge](/badges/andrewhaine-silverstripe-sitetree-inheritance-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/andrewhaine-silverstripe-sitetree-inheritance-helpers/health.svg)](https://phpackages.com/packages/andrewhaine-silverstripe-sitetree-inheritance-helpers)
```

PHPackages © 2026

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