PHPackages                             marionnewlevant/mega-merge - 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. [Templating &amp; Views](/categories/templating)
4. /
5. marionnewlevant/mega-merge

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

marionnewlevant/mega-merge
==========================

Merge this that and the other... With twig parsing

2.0.0(3y ago)1113MITPHP

Since Feb 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/marionnewlevant/craft-megamerge)[ Packagist](https://packagist.org/packages/marionnewlevant/mega-merge)[ RSS](/packages/marionnewlevant-mega-merge/feed)WikiDiscussions v2 Synced today

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

MegaMerge plugin for Craft CMS 4.x
==================================

[](#megamerge-plugin-for-craft-cms-4x)

MegaMerge: mergeMegaMerge provides a fieldtype which is a Craft table with predefined `Key` and `Value` columns. It lets you merge together those fields with php arrays and twig arrays, and then look up values of keys in the merged array. The resultant values are parsed as twig.

This is a general purpose utility, though one of its potential uses (and the one for which I wrote it) is as a do-it-yourself seo system.

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

[](#requirements)

This plugin requires Craft CMS 4.0.0 or later.

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

[](#installation)

1. Install with Composer via `composer require marionnewlevant/mega-merge` from your project directory
2. Install plugin in the Craft Control Panel under Settings &gt; Plugins

or

1. Install via the Plugin Store

MegaMerge Overview
------------------

[](#megamerge-overview)

MegaMerge provides a fieldtype (a key/value table) and three functions:

`craft.megaMerge.init()` is passed an array of key/value pairs (elements in this array can be megaMerge fields, php arrays, or twig arrays), and a context object. It adds the key/value pairs to a global collection of key/value pairs, and the context object to a global context object.

`craft.megaMerge.reset()` sets the global key/value pairs and the global context to empty.

`craft.megaMerge.value(key)` looks up the value associated with key in the key/value pairs, interprets it as twig using the global context, and retuns the parsed value. It returns `null` if there is no matching value.

Using MegaMerge
---------------

[](#using-megamerge)

**The key/value pairs** A megaMerge field called `globalSettings` in the `g_configuration` global set:

[![megaMergeField](docs/megaMergeField.png)](docs/megaMergeField.png)

Settings defined in config/custom.php:

```
'megaMerge' => [
    'title' => 'MySite page',
],
```

**Calling `init`** The `globalSettings` values will override the `config.general.megaMerge` ones:

```
{% do craft.megaMerge.init([
    craft.app.config.custom.megaMerge,
    g_configuration.globalSettings
  ], {object: entry}) %}
```

**Calling `value`**

```
{{ craft.megaMerge.value('title') }}
```

Brought to you by [Marion Newlevant](http://marion.newlevant.com). Icon insides by [Dmitry Baranovskiy from the Noun Project](https://thenounproject.com/term/merge/5026/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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

Total

4

Last Release

1185d ago

Major Versions

v1.x-dev → 2.0.02023-02-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/695477?v=4)[Marion Newlevant](/maintainers/marionnewlevant)[@marionnewlevant](https://github.com/marionnewlevant)

---

Top Contributors

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

---

Tags

cmsCraftcraftcmscraft-pluginmegamerge

### Embed Badge

![Health badge](/badges/marionnewlevant-mega-merge/health.svg)

```
[![Health](https://phpackages.com/badges/marionnewlevant-mega-merge/health.svg)](https://phpackages.com/packages/marionnewlevant-mega-merge)
```

###  Alternatives

[lewisjenkins/craft-dynamic-fields

Populate Craft fields with dynamic data using the power of Twig.

14667.0k](/packages/lewisjenkins-craft-dynamic-fields)[nystudio107/craft-minify

A simple plugin that allows you to minify blocks of HTML, CSS, and JS inline in Craft CMS templates.

37461.2k29](/packages/nystudio107-craft-minify)[jalendport/craft-preparse

A fieldtype that parses Twig when an element is saved and saves the result as plain text.

1086.4k](/packages/jalendport-craft-preparse)[craftpulse/craft-colour-swatches

Let clients choose from a predefined set of colours and utilise associated colour codes and class names in your templates.

3530.8k2](/packages/craftpulse-craft-colour-swatches)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.3k](/packages/verbb-footnotes)

PHPackages © 2026

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