Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Content Browser Ezplatform Laravel Package

netgen/content-browser-ezplatform

eZ Platform integration for Netgen Content Browser. Provides the backend adapter and configuration needed to browse, search, and select eZ Platform content from the Content Browser interface, so editors can reuse existing items in admin UIs.

View on GitHub
Deep Wiki
Context7

Getting Started

Prerequisites. This bundle targets eZ Platform 2.x (Symfony 3.4/4.x, PHP 7.x). It is a companion to the core netgen/content-browser bundle — it does not ship the browsing UI, routes or admin shell. Install both, and pin versions against your eZ Platform release (see Gotchas).

composer require netgen/content-browser netgen/content-browser-ezplatform

Register the core bundle before the integration bundle (eZ Platform 2 → app/AppKernel.php, Symfony 4 flex-style apps → config/bundles.php):

new Netgen\ContentBrowserBundle\NetgenContentBrowserBundle(),
new Netgen\ContentBrowser\EzPlatform\NetgenContentBrowserEzPlatformBundle(),

Then import the bundle routing (usually netgen_content_browser_ezplatform / the core netgen_content_browser routes), publish assets (bin/console assets:install --symlink), and clear cache.

Where to look first.

  1. vendor/netgen/content-browser-ezplatform/Resources/config/ — this is the authoritative place for service IDs, the item-type/backend registration and (in versions that ship one) the eZ field type definition. Class names and config keys drift between releases; read these files rather than trusting blog posts.
  2. vendor/netgen/content-browser/src/Backend/BackendInterface.php in the core bundle — the backend here implements this contract (loadItem, search, getColumns, getItemValue…). Once you understand this interface, the integration is transparent.
  3. The Item class of the integration — tells you exactly what an "item" is (a content or a location), and therefore what you store in your own content.

First use case. Declare one item type per browsing purpose, rooted at a container location:

netgen_content_browser:
    item_types:
        images:
            name: 'Images'
            backend: ezcontent          # the eZ Platform backend service alias
            params:
                root_location_id: 43    # e.g. your "Media/Images" container
                columns: [name, type]

Reload the admin, open the Content Browser, and confirm the tree renders and an image can be selected. That single smoke test exercises routing, the backend service, the eZ repository permissions and the UI assets at once — if it works, the wiring is correct.

Implementation Patterns

One item type per root, not one per content type. The usual layout is images, files and maybe documents, each with its own root_location_id. Editors then see a narrowed tree instead of the whole content tree, which is both a UX win and a permissions shortcut. columns and search settings are per item type, so this is also how you tune what's searchable.

Storing and resolving selections. A Content Browser value is a scalar item ID — in eZ Platform terms a location ID. Store it with your own field/tag, then resolve at render time through the backend service rather than hardcoding a repository call:

$item = $this->backend->loadItem($storedLocationId);   // backend for item type "images"
if ($item !== null && $item->isVisible()) {
    // $item->getValue() === location id, $item->getName() has the label
}

If the integration ships an eZ field type (check Resources/config for the field type service and its identifier), prefer it — you get storage, validation and the picker button "for free" and skip the custom controller entirely.

Search. The browser delegates search to the backend, which uses the configured eZ search engine (legacy/ezpublish.search.engine or Solr). Configure root locations and content types in the item-type params so fulltext hits aren't dominated by unrelated content. If Solr is in use, remember the index must be current — an empty result panel usually means the index, not the bundle.

Permissions are inherited, not re-implemented. The backend queries LocationService/ContentService as the currently logged-in user, so editors see exactly the subtree they can read. Use eZ roles to shape the browser; don't try to filter with custom code.

Extension points. Almost every behaviour change belongs in a decorator around the backend service (decorates: in your service config) or a subclass of the integration's Item — for example to add a custom column, change how an item's type label is computed, or expose an extra URL for previews. Keep decorators thin and delegate everything else.

Integration with Netgen Layouts / eZ admin UI. This package is most commonly consumed indirectly: as the content picker inside Netgen Layouts' eZ Platform integration or in the eZ admin. If you're wiring it into your own admin screen, reuse the bundle's own routes and JS rather than writing a second picker.

Gotchas and Tips

Version matrix first, code second. This is an eZ Platform 2.x-era, low-traffic package (single-digit stars, no dependents). Before installing, diff its composer.json constraints against your Symfony/PHP/eZ versions. For Ibexa 4.x you want the newer netgen/content-browser-ibexa, not this. If you're stuck on an abandoned version, fork and pin — don't rely on it tracking your platform upgrade.

Location ID ≠ content ID. Items are keyed by location ID. Moving or copying content changes the stored value, and deleting a location leaves a dangling ID in your content. Always null-check loadItem() and check isVisible() in templates; never assume the stored ID still resolves.

Empty tree almost always means permissions or root location. Check, in order: the root_location_id exists and isn't trashed, the current user has content/read on that subtree, and the cache is clear. Nothing renders for anonymous users by default in a locked-down install.

Assets and cache. A blank white Content Browser panel is nearly always unpublished assets (assets:install, symlink permissions) or stale cache after a YAML change. Both are cheap to rule out — do it before reading the JS.

Search and language. Item names come from the current siteaccess/translation. Browsing in a language that has no translation on the content yields odd labels; set the translation explicitly in config if your editorial content is multilingual.

Debugging tips. bin/console debug:container --tag=netgen.content_browser.backend confirms the integration registered its backend; debug:router confirms the UI routes exist. Logs under the netgen_content_browser channel plus the Symfony profiler's Doctrine/repository panel show the actual eZ queries, which is where permission surprises surface.

License. GPL-2.0 is copyleft. Fine for internal use and for a self-hosted application, but anything you redistribute built on top of it is a conversation to have with legal before you start, not after.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels