General

  eZ Systems Website
  Editor documentation


  Developer documentation

  Back to the top

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated paragraph about repository-forms, as it is also used by the kernel

Introduction

Content Edit

Status
colourYellow
titlev1.2

eZ Platform comes with content edition features via the Symfony stack. They are meant, in addition the PlatformUI's editing capabilities, to allow the implementation of User Generated Content from the frontend.

Usage

Creating a content item without using a draft

As of eZ Platform 1.2, a new /content/edit/nodraft route is available. It will show a Content item creation form for a given Content Type:

argumenttypedescription
contentTypeIdentifierstringThe identifier of the content type to create. Example: folder, article
languageCodestringLanguage code the content item must be created in. Example: eng-GB
parentLocationIdintegerID of the Location the content item must be created in. Example: 2

For now a very limited subset of Field Types is supported. These are:

  • Status
    colourYellow
    titlev1.2
    TextLine and TextBlock
  • Status
    colourYellow
    titlev1.4
    Selection, Checkbox and User

More will be added in the near future.

Registering new users

Status
colourYellow
titlev1.4

You can allow your users to create accounts by employing the /register route. This route leads to a registration form that, when filled in, creates a new User Content item in the repository.

User Groups

By default, new Users generated in this way are placed in the Guest accounts group. You can select a different default group in the following section of configuration:

Code Block
ezpublish:
    system:
        default:
            user_registration:
                group_id: <userGroupContentId>

Registration form templates

You can use custom templates for the registration form and for the registration confirmation page.

These templates are defined with the following configuration:

Code Block
ezpublish:
    system:
        default:
            user_registration:
                templates:
                    form: 'user/registration_form.html.twig'
                    confirmation: 'user/registration_confirmation.html.twig'

with the following templates in app/Resources/views/user/registration_form.html.twig:

Code Block
{% extends noLayout is defined and noLayout == true ? viewbaseLayout : pagelayout %}
{% block content %}
     {% import "EzSystemsRepositoryFormsBundle:Content:content_form.html.twig" as contentForms %}
     
     <section class="ez-content-edit">
         {{ contentForms.display_form(form) }}
     </section>
{% endblock %}

and in app/Resources/views/user/registration_confirmation.html.twig:

Code Block
{% extends noLayout is defined and noLayout == true ? viewbaseLayout : pagelayout %}
{% block content %}
    <h1>Your account has been created</h1>
    <p class="user-register-confirmation-message">
        Thank you for registering an account. You can now <a href="{{ path('login') }}">login</a>.
    </p>
{% endblock %}

 

Repository Forms

This package provides form-based interaction for the Repository Value objects.

It is currently used by by:

  • ezsystems/platform-ui-bundle for most management interfaces: Sections, Content Types, Roles, Policies, etc.
Other forms in Platform that interact with the Repository will also be based on it (User registration, or any form on the frontend that manipulates content or other repository objects).
  • ezsystems/ezpublish-kernel for user registration, and user generated content

In this topic:

Table of Contents
maxLevel3