PHPackages                             splashfrog/leap\_smartpaths - 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. splashfrog/leap\_smartpaths

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

splashfrog/leap\_smartpaths
===========================

Enterprise state-aware hierarchical URL alias management for Drupal 11.

1.0.1(1mo ago)03↓100%GPL-3.0-or-laterPHPPHP &gt;=8.3

Since Apr 30Pushed 1mo agoCompare

[ Source](https://github.com/SplashFrog/leap-drupal-smartpaths)[ Packagist](https://packagist.org/packages/splashfrog/leap_smartpaths)[ Docs](https://github.com/SplashFrog/leap-smartpaths)[ RSS](/packages/splashfrog-leap-smartpaths/feed)WikiDiscussions main Synced 1w ago

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

Splash Frog - LEAP Smart Paths
==============================

[](#splash-frog---leap-smart-paths)

**Enterprise state-aware hierarchical URL alias management for Drupal 11.**

The LEAP Smart Paths module solves the massive headache of managing nested URL aliases (e.g., `/services/consulting/enterprise`) and moderation state visibility (e.g., `/archived/services/...`) at an enterprise scale.

It replaces the brittle Drupal core Menu routing system with a robust Entity Reference chain, allowing content to inherently know its place in the site architecture.

---

✨ Key Features
--------------

[](#-key-features)

- **Dynamic Nesting:** Introduces the `[node:parent_path]` Pathauto token. It recursively traverses up a node's "Parent Page" entity reference chain to build a full URL prefix dynamically.
- **Cascading Updates:** If a parent node is renamed or moved, the `SmartPathsService` automatically cascades the URL update down to all of its children, grandchildren, and great-grandchildren.
- **Configurable State Prefixing:** (The URL Decorator) Site builders can configure specific moderation workflow states to automatically prepend URL slugs. For example, moving a page to the `Archived` state can automatically change its URL from `/services` to `/archived/services`.
- **Intelligent Opt-Outs:** (The Cascade Guard) Site builders can designate specific workflow states to "Opt-Out" of cascading updates. If a child node is in an opted-out state (like `Trash`), it will safely ignore structural changes made to its parent.
- **Entity-Agnostic Prefixing:** The state prefixing engine works on **any** content entity that uses Pathauto and Content Moderation, including Nodes, Media, and Taxonomy Terms.
- **Enterprise Performance Engine:** Capable of handling massive alias cascades (e.g., a parent with 5,000+ children) without causing PHP timeouts.
    - **Hybrid Dispatch:** Small updates (&lt;100 nodes) run synchronously. Large updates automatically trigger the **Drupal Batch API** to provide visual progress bars to the editor.
    - **Flat Discovery:** Recursively flattens the descendant tree up-front to prevent infinite save loops.
    - **Static Caching:** Uses `drupal_static` memory caching during tree traversal to eliminate 99% of redundant database queries when processing large batches.

---

🛠️ Requirements
---------------

[](#️-requirements)

- **Drupal:** ^11.3
- **PHP:** &gt;=8.3
- **Modules:** `pathauto`, `token`, `views`

---

🚀 Installation &amp; Setup
--------------------------

[](#-installation--setup)

1. **Enable the Module:**

    ```
    drush en leap_smartpaths
    ```
2. **Apply the Fields Recipe:**This module relies on specific fields (`field_parent_content` and `field_optional_path`) to construct the hierarchy. Apply the associated configuration recipe to attach these to your desired content types.

    ```
    drush recipe modules/contrib/leap_smartpaths/recipes/leap_smartpaths
    ```

    *Note: If you are using the LEAP Starter ecosystem, ensure the `leap_content` recipe is applied first.*
3. **Configure Workflow Rules:**Navigate to `/admin/config/search/leap-smartpaths` to configure your State Prefixes and Opt-Out rules.

---

🧩 How It Works
--------------

[](#-how-it-works)

### The Dual-Configuration Engine

[](#the-dual-configuration-engine)

The module strictly separates the concept of "Cascading Inheritance" from "URL Decoration", allowing them to work together or entirely independently.

1. **Opt-Out (Cascading Inheritance):**When a parent's URL changes, the system looks at all children. If a child is in an "Opt-Out" state, it skips that child.
2. **Prefixing (URL Decoration):**When an entity is saved (manually or via Pathauto), the system performs a **Surgical Strip**. It uses a strict regex to strip any known prefixes from the very beginning of the alias (preventing duplicate `/trash/archived/node` structures), and then prepends the prefix specific to the entity's *current* state.

### The Tokens

[](#the-tokens)

- `[node:parent_path]`: Recursively builds the URL prefix. **Crucial:** Ensure `parent_path` is added to your Pathauto 'Safe tokens' list in configuration, otherwise Drupal will convert the forward slashes `/` into hyphens `-`. (Our recipe handles this automatically).
- `[node:optional_title]`: Uses the `field_optional_path` if provided, otherwise falls back to the standard node title. This allows editors to have long page titles (H1s) but short URL slugs.

---

👨‍💻 Developer API
-----------------

[](#‍-developer-api)

Developers can access the URL generation and mass-update logic directly via the strictly-typed service:

```
/** @var \Drupal\leap_smartpaths\SmartPathsService $smart_paths */
$smart_paths = \Drupal::service('leap_smartpaths.logic');

// Apply a state prefix to a raw string manually:
$decorated_alias = $smart_paths->applyStatePrefix('/my-raw-alias', $entity);
```

---

🛡️ License
----------

[](#️-license)

This module is available under the standard Drupal General Public License (GPL) version 2 or later.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance92

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

40d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/226536283?v=4)[Splash Frog](/maintainers/SplashFrog)[@SplashFrog](https://github.com/SplashFrog)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/splashfrog-leap-smartpaths/health.svg)

```
[![Health](https://phpackages.com/badges/splashfrog-leap-smartpaths/health.svg)](https://phpackages.com/packages/splashfrog-leap-smartpaths)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.3k7.0k1](/packages/farmos-farmos)

PHPackages © 2026

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