Download the PHP package digitalwerk/content-element-registry without Composer

On this page you can find all versions of the php package digitalwerk/content-element-registry. 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 content-element-registry

⚠️ Project migrated ⚠️

Project was migrated to another project.

Please continue in this project

Content element registry

Typo3 extension simplify process of creating new content elements (CE) in Typo3 way

Install

Install extension via composer composer req digitalwerk/content-element-registry and activate it in Extension module

Setup

After activating extension, you have to define your Content elements configuration classes. It can be done in two ways:

  1. By defining paths in extension configuration (aka extConf). Can contain comma separated list of paths to directories Example: EXT:your_ext_1/Classes/ContentElements/,EXT:your_ext_2/Classes/ContentElements/

  2. By registering Listener in Services.yaml of your extension as follows:

Method Vendor\Extension\EventListeners\ContentElementRegistryListener can looks like this:

Creating new content element

To create new Content element you have to create new Class inside your folder defined in Setup section which extends Digitalwerk\ContentElementRegistry\ContentElement\AbstractContentElementRegistryItem

After clearing typo3 caches you should now see new content element in wizard

As you can see, there is neither title nor description of the content element. These are automatically fetched and translated from locallang file inside of your extension: EXT:your_extension/Resources/Private/Language/locallang_db.xlf. You can now define your CE title and description as follows:

When you add this new CE it will contain only default CE fields:

Adding CE fields

To add new fields you have to define it in \YourVendor\YourExtension\ContentElement\YourNewContentElement:

By this, we defined new CE palette with name default with two fields header and bodytext.

Code description:

  1. Name of the palette must be unique per CE. Label for palette can be defined in locallang_db.xlf with following key: tt_content.yourextension_yournewcontentelement.palette.default
  2. Fields definition syntax must follows TCA palette showitem syntax
  3. Used fields must be properly configured in tt_content TCA
  4. You can add as many palettes as you need ;)

Our CE now should looks like this:

If you need to override field configuration you can do this in this way: (In following example we've enabled rich text editor for bodytext field)

CE Template

Template path of content element must be configured in typoscript as follow:

Template name is matched by CE class name. E.g. if is registered CE with class name YourNewContentElement this template must exists EXT:your_extension/Resources/Private/Templates/ContentElements/YourNewContentElement.html. Content of template can looks like this:

Whether you use <f:layout /> and <f:section /> it's fully up to you. You can also add section <f:section name="Preview"> which is used for BE preview.

CE Icon

If you don't want to use the defaut icon, you can change it:

CE Domain Model

Model name is matched by CE class name. E.g. if is registered CE with class name YourNewContentElement this model can exists in EXT:your_extension/Classes/Domain/Model/YourNewContentElement.php Content of model can looks like this:

Into class you can write some functions, getters, setters, etc. Some of them are inherited from DigitalWerk\ContentElementRegistry\Domain\Model\ContentElement (take a look ;).

Model in template

Model is accessible in the template of element with variable name {contentElement}. To find out what data is loaded in the model in the template use: <f:debug>{contentElement}</f:debug>.

Create a new field and setup

Create a new field

  1. Create a field in the table ext_table.sql, e.g. new_field.
  2. In the TCA EXT:your_extension/Configuration/TCA/Overrides/tt_content.php create new column and config Typo3 Columns Config:

Setup a new field

Content element with IRRE

Mapping

Map in ext_typoscript_setup.typoscript relation table to CE model:

Register relation icon

You can register relation icon using Typo3 Icon API

Relation TCA

In TCA EXT:your_extension/Configuration/TCA/Overrides/tx_contentelementregistry_domain_model_relation.php create:

Relation add to CE

Add name of relation to palette:

Relation model

CE field mapping

In Class of CE you can map field, when you want to use it in model, e.g. tx_contentelementregistry_relations is called in the model txContentelementregistryRelation, but after mapping 'tx_contentelementregistry_relations' => 'relations',tx_contentelementregistry_relations is called in the model relations.

Changelog

v1.0.0


All versions of content-element-registry with dependencies

PHP Build Version
Package Version
Requires typo3/cms-core Version >=12.0.0 <12.9.9
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 digitalwerk/content-element-registry contains the following files

Loading the files please wait ....