PHPackages                             bit3/contao-deeplinks - 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. bit3/contao-deeplinks

AbandonedArchivedContao-module

bit3/contao-deeplinks
=====================

Create deeplinks for your Contao modules in the backend menu.

1.0.2(12y ago)117LGPL-3.0+PHPPHP &gt;=5.3

Since Oct 3Pushed 12y ago1 watchersCompare

[ Source](https://github.com/bit3archive/contao-deeplinks)[ Packagist](https://packagist.org/packages/bit3/contao-deeplinks)[ RSS](/packages/bit3-contao-deeplinks/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (5)Used By (0)

Deeplinks
=========

[](#deeplinks)

[![Build Status](https://camo.githubusercontent.com/fe491fe8b83c721226255a21d8e2c26d2f49941fa9444f3ace0cb53b08a4764b/68747470733a2f2f7472617669732d63692e6f72672f626974332f636f6e74616f2d646565706c696e6b732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bit3/contao-deeplinks) [![mess checked](https://camo.githubusercontent.com/3930b3d82f749b3f915afd70158bd063cdcd51b86520d64182ced527689cb67d/68747470733a2f2f626974332e64652f66696c65732f49636f6e732f6d6573732d636865636b65642e706e67)](https://github.com/bit3/php-coding-standard) [![style checked](https://camo.githubusercontent.com/bf98eaec1f3dc8be973072c2eb355f3873948abffbb81d6dadbc649c72c4ec9f/68747470733a2f2f626974332e64652f66696c65732f49636f6e732f7374796c652d636865636b65642e706e67)](https://github.com/bit3/php-coding-standard)

Contao does not support backend menu items that are deeplinks to special functions or deep links to specific records. The deeplinks extension make it possible to define menu items, that work as deep links and also highlighted as active, if the link is opened.

Define deep links
-----------------

[](#define-deep-links)

You define deep links in the global `$GLOBALS['BE_MOD']` array, like normal menu items.

```
$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&id=1',
	'search'     => 'do=my_menu&table=tl_my_table&id=1',
	'deepsearch' => true,
	'priority'   => 10,
);

$GLOBALS['BE_MOD']['my_module']['my_menu'] = array(
	'tables'     => array('tl_my_table', 'tl_my_sub_table'),
	'icon'       => 'system/modules/my_module/assets/images/my_menu.png',
);
```

As you can see in the `my_deeplink` menu item, the `deeplink` property define the query string for the deep link. If you click on the menu item, you will be redirected to `/contao/main.php?`.

The `search` property is required to find the correct deep link in the menu. If no `search` property is defined, the `deeplink` property will be used. The parameters from `search` will be matched against the GET-Parameters. If all parameters match, the deep link is supposed to be active.

Hint: The `table` parameter is special here, if no `$_GET['table']` is defined, the algorithm search the menu item that match the `$_GET['do']` parameter (in the example above, it will be `$GLOBALS['BE_MOD']['my_module']['my_menu']`) and use the first table (`tl_my_table`) of it in replacement of the `$_GET['table']` parameter.

Hopefully you can see now, why there is a difference between `deeplink` and `search`. `search` is usually only needed, if `deeplink` does not contain a `table` parameter.

The `deepsearch` property tell the algorithm to search from child tables up to the top tables. That means, if the table `tl_my_sub_table` is a child table of `tl_my_table`, the algorithm search through the records in the parent-child tables, until the table defined in `search` is found or there is no more parent table defined. The deep search require a correct `ptable`/`ctable` definition in the DCA. Currently `DC_Table` is the only supported DataContainer type.

By default `deepsearch` is **enabled**!

The `priority` property give you control over the matching priority, if you have more deeplinks that compete. By default the algorithm will go up-down through the menu items and break on the first menu item, that match. But if you have two compete items, a "deeper" item that is below the less-deep item, the less-deep item may shown as active, even if the deeper item match "better".

```
$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&id=1',
	'search'     => 'do=my_menu&table=tl_my_table&id=1',
	'priority'   => 10,
);
$GLOBALS['BE_MOD']['my_module']['my_deeplink_edit'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&act=edit&id=1',
	'search'     => 'do=my_menu&act=edit&table=tl_my_table&id=1',
	'priority'   => 11,
);
```

In this example `my_deeplink` and `my_deeplink_edit` will match on the url `main.php?do=my_menu&id=1&act=edit`. But the priority of `my_deeplink_edit` is higher, so even if `my_deeplink` match the search and is the first matching item, `my_deeplink_edit` will be supposed to be active.

By default `priority` is set to **10**!

Dynamic deep links
------------------

[](#dynamic-deep-links)

Deep links make more sense, if you create them dynamically. For this you can use the `deeplinks-create` event, that is dispatched in an early system initialisation state.

To listen on the event, put the following into your `config.php`:

```
$GLOBALS['TL_EVENTS']['deeplinks-create'][] = array('MyClass', 'eventShortcutsCreate');
```

Then create a class `MyClass`:

```
class MyClass
{
	static public function eventShortcutsCreate()
	{
		$database = \Database::getInstance();

		// fetch items from database and create
		// the items in $GLOBALS['BE_MOD'] dynamically
	}
}
```

Hint: It is not necessary to use the `deeplinks-create`. You can define the items in `$GLOBALS['BE_MOD']` everywhere and everytime you want. But if you create your items **after** the `deeplinks-create` event, you need to define the callback by yourself!

```
$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	...
	'callback' => 'Bit3\Contao\Deeplinks\Deeplinks',
);
```

For all items defined before the `deeplinks-create` event, the callback will be added dynamically.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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 ~6 days

Total

3

Last Release

4590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e61f74ea186c1e79e072b2974ccdeef39414730476d5a8adac501eb9449b2a3?d=identicon)[tril](/maintainers/tril)

---

Top Contributors

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

---

Tags

modulecontaodeeplinkshotlinks

### Embed Badge

![Health badge](/badges/bit3-contao-deeplinks/health.svg)

```
[![Health](https://phpackages.com/badges/bit3-contao-deeplinks/health.svg)](https://phpackages.com/packages/bit3-contao-deeplinks)
```

PHPackages © 2026

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