Download the PHP package perspeqtive/sulu-media-credits-bundle without Composer

On this page you can find all versions of the php package perspeqtive/sulu-media-credits-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sulu-media-credits-bundle

SuluMediaCreditsBundle

Packagist Version

The Sulu Media Credits Bundle enables the automatic listing of media credits for media used on the current website. It scans the content via the reference bundle of the current website for linked media and provides them collectively for display.

🚀 Features

🛠️ Installation

Install the bundle via composer:

Activate the bundle

If you are not using symfony flex, register it in your config/bundles.php:

🛠️ Usage

The bundle provides a Twig function that returns a collection of all media references on the current website.

Twig Function

Use media_credits() to retrieve the credits collection.

Data Structure

The media_credits() function returns a CreditsCollection object, which iterates over Credits objects.

Property Type Description
mediaId int The ID of the medium
title string The title/name of the medium
copyright string The copyright field from the metadata
credit string The credit field from the metadata
references MediaReferenceCollection Collection of references where the file is linked

Within item.references.next (MediaReference):

Property Type Description
title string Title of the linked page/resource
resourceId string The target resources unique identifier
resourceType string The target resource key like 'pages' or 'articles'
url string URL to the resource

⚠️ Caution:

Only images directly used in page-types are considered for reference linking. When using snippets or custom entities, the references are not returned. The credit and copyright information is still available.

🛠️ Extending the Bundle

If you want to support additional media references (e.g., from custom entities or snippets), you can extend the bundle by implementing two interfaces.

1. Implement ReferenceByTypeRepositoryInterface

This interface is responsible for finding references for a specific media ID.

2. Implement UrlRepositoryByTypeInterface

This interface is responsible for generating the URL for a found reference.

3. Register the Services

The bundle uses tagged iterators to collect all repositories.

Via Autowire & Autoconfigure

If your application uses autoconfigure: true, the services will be registered automatically because the bundle registers the interfaces for autoconfiguration.

Manual Registration

If you don't use autoconfigure, you must add the tags manually:

👩‍🍳 Contribution

Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.


All versions of sulu-media-credits-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
sulu/sulu Version ~2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package perspeqtive/sulu-media-credits-bundle contains the following files

Loading the files please wait ...