PHPackages                             fosforus/authblock-shortcode - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fosforus/authblock-shortcode

ActiveSilverstripe-vendormodule[Authentication &amp; Authorization](/categories/authentication)

fosforus/authblock-shortcode
============================

Creates a shortcode block to test if a user is logged in or not and render content as desired.

4.0.1(7y ago)08BSD-2-ClausePHP

Since Dec 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tkiehne/authblock-shortcode)[ Packagist](https://packagist.org/packages/fosforus/authblock-shortcode)[ RSS](/packages/fosforus-authblock-shortcode/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

AuthBlock Shortcode Module
==========================

[](#authblock-shortcode-module)

[![Version](https://camo.githubusercontent.com/bf05ff88cf19ecfd4ff4c1e102188152c6333411f2a832899e29d7ef1a82be55/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f73666f7275732f61757468626c6f636b2d73686f7274636f64652e7376673f7374796c653d666c6174)](https://packagist.org/packages/fosforus/authblock-shortcode)[![License](https://camo.githubusercontent.com/e567f1f70d212bca1ce37b2f9a0258c6594a8b6a62133d3b3bc416922766fc2d/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666f73666f7275732f61757468626c6f636b2d73686f7274636f64652e7376673f7374796c653d666c6174)](LICENSE)

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

[](#requirements)

- SilverStripe CMS 4.2+

Installation
------------

[](#installation)

```
composer require fosforus/authblock-shortcode

```

Usage
-----

[](#usage)

In any shortcode-enabled editor field (HTMLEditor, et al.), place this shortcode around blocks of content you wish to "gate" based on the logged-in state of the user. E.g.: to show a specific block of content only to a user that is currently logged in:

```
[authblock auth="true"]Hello, member![/authblock]

```

To show content only to a logged-out (anonymous) user:

```
[authblock auth="false"]You may log in here.[/authblock]

```

Note that due to [shortcode nesting restrictions](https://docs.silverstripe.org/en/4/developer_guides/extending/shortcodes/#limitations), you may not place shortcodes within the `authblock`. For more complex situations, consider creating custom template variables in your Controller(s).

You may also set a single permission to further qualify the authentication check, e.g.:

```
[authblock auth="true" perm="CMS_ACCESS"]Edit the site here.[/authblock]

```

In this case, if the user is not authenticated with the site or the user doesn't have access to any of the CMS (via `CMS_ACCESS_*` permissions), the block content will not show. Again, for more complex permission checks, extend your Controller(s).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2db1963e0ee620dae19cf13c2391c1c37d71a5108765e06e700c4272e3107e8d?d=identicon)[tkiehne](/maintainers/tkiehne)

---

Top Contributors

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

---

Tags

silverstripeshortcode

### Embed Badge

![Health badge](/badges/fosforus-authblock-shortcode/health.svg)

```
[![Health](https://phpackages.com/badges/fosforus-authblock-shortcode/health.svg)](https://phpackages.com/packages/fosforus-authblock-shortcode)
```

###  Alternatives

[silverstripe/contentreview

Flags pages for periodical author review (incl. reporting)

22264.3k4](/packages/silverstripe-contentreview)[symbiote/silverstripe-memberprofiles

Member registration and profile management

10152.3k3](/packages/symbiote-silverstripe-memberprofiles)[silverstripe/mfa

Enable multi-factor authentication with fallback codes

10346.1k8](/packages/silverstripe-mfa)[bigfork/silverstripe-oauth-login

SilverStripe logins via OAuth2, using the PHP League's OAuth2 client

1794.7k2](/packages/bigfork-silverstripe-oauth-login)

PHPackages © 2026

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