PHPackages                             pbe/base-bundle - 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. pbe/base-bundle

ActiveLibrary[Templating &amp; Views](/categories/templating)

pbe/base-bundle
===============

Webpage helper bundle for eZ Publish Platform (dropdown menu from folders and links, twig content fetcher function)

1111PHP

Since Sep 24Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pbek/PBEBaseBundle)[ Packagist](https://packagist.org/packages/pbe/base-bundle)[ RSS](/packages/pbe-base-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PBE Base Bundle
===============

[](#pbe-base-bundle)

The **PBE Base Bundle** is a **webpage helper bundle** for the [**eZ Publish 5 Platform**](http://ez.no).

You may also want to visit the [PBEBaseBundle Project Webpage](http://www.bekerle.com/PBEBaseBundle) for more informations.

Implemented features
--------------------

[](#implemented-features)

- Two level **top menu** generation from a folder with **folders and links** to be included in the pagelayout.
- `pbe_fetch_content` twig function to **load content** in **twig** templates. This could, for example, be used in the pagelayout to load content from an **object relation list**.

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

[](#installation)

First you'll need **composer**, if you don't already have it. You can execute this in your eZ Publish root directory.

```
curl -sS https://getcomposer.org/installer | php
```

Then you can **require** the bundle:

```
php composer.phar "pbe/base-bundle":"dev-master"
```

Now you have to **add** the **bundle** to your `ezpublish/EzPublishKernel.php`:

```
use PBE\BaseBundle\PBEBaseBundle;

...

public function registerBundles()
{
   $bundles = array(
       new FrameworkBundle(),
       ...
       new PBEBaseBundle()
   );

   ...
}
```

Finally you need to **add** the `base.css` file to your `page_head_style.html.twig` like this:

```
{% stylesheets
    '@eZDemoBundle/Resources/public/css/bootstrap.css'
    ...
    '@PBEBaseBundle/Resources/public/css/base.css'
%}

{% endstylesheets %}
```

To **override** code of the **PBEBaseBundle** you can also make it **parent** of your bundle.

```
public function getParent()
{
    return 'PBEBaseBundle';
}
```

Take a look at [How to Use Bundle Inheritance to Override Parts of a Bundle](http://symfony.com/doc/current/cookbook/bundles/inheritance.html) for **more information.**

Usage
-----

[](#usage)

### top menu generator

[](#top-menu-generator)

Just include this code into your `pagelayout.html.twig` where you want to put your **main menu**. In this example `86` is the location id of the parent folder.

```
{{ render( controller( "PBEBaseBundle:Menu:topMenuFromFolder", { 'parentFolderLocationId': 86 } ) ) }}
```

##### This may look like this

[](#this-may-look-like-this)

[![Screenshot top-menu](screenshot-top-menu.png)](screenshot-top-menu.png)

#### Injecting other sub-locations to directly link to

[](#injecting-other-sub-locations-to-directly-link-to)

You can also add **sub-locations** that are directly linked to in your menu.

For example for your menu entry with the location id `101` additionally load a maximum of `8` items of location `locationId`.

```
{{ render( controller( "PBEBaseBundle:Menu:topMenuFromFolder", {
                        'parentFolderLocationId': 86,
                        'directlyIncludedLocations': {
                            101: {
                                'locationId': 70,
                                'limit': 8
                            }
                        }
                    } ) ) }}
```

##### This may look like this

[](#this-may-look-like-this-1)

The "Blog" menu entry has the `locationId` `101`. The blog posts are directly loaded from the blog (`'locationId': 70`).

[![Screenshot top-menu with directly loaded locations](screenshot-top-menu-with-directly-loaded-locations.png)](screenshot-top-menu-with-directly-loaded-locations.png)

### pbe\_fetch\_content

[](#pbe_fetch_content)

You can use this **twig function** in your templates to **load content**. In this example `57` is the content id.

```
{% set content = pbe_fetch_content( 57 ) %}
```

It will return a `\eZ\Publish\Core\Repository\Values\Content\Content` object.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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://avatars.githubusercontent.com/u/1798101?v=4)[Patrizio Bekerle](/maintainers/pbek)[@pbek](https://github.com/pbek)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/pbe-base-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pbe-base-bundle/health.svg)](https://phpackages.com/packages/pbe-base-bundle)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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