General

  eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
 
Technical documentation:



⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Skip to end of metadata
Go to start of metadata

 

 

We will customize the Google map later, now let's inject and display all Points of interest within the view.

Points Of Interest

Go to Admin Panel > Content Types, and under the "Content"  group, create the Point Of Interest Content Type.

Create the Point Of Interest (POI) Content Type

A geographical location rides go through. Each ride may be related to as many points of interest as needed.

Name: Point of interest
Identifier: point_of_interest
Content name pattern: <name> 

Then create all fields with the following information: 

  • Name: identifier name; field type textLine (Required / Searchable / Translatable)
  • Description: identifier description; field type Rich Text (Required / Searchable / Translatable)
  • Photo: identifier image; field type Image (Required / Searchable)
  • Legend: identifier legend; field type Rich Text (Required / Searchable / Translatable)
  • Place: identifier place; field type MapLocation (Required / Searchable)

The content name pattern defines how the name and URL part of Content items of this type will be built. It may include static strings, as well as references to field definitions, using their identifier.

The value of the fields referenced in the pattern will be used to build the name. Most Field Types are able to render a textual representation of their value, but be aware that it is not implemented for some of them (Selection FieldType, Relation FieldType, RelationList FieldType).

Create some Points Of Interest in the Content tree. Note that you will need pictures (for the Photo, the image Field) to represent these Points Of Interest.

Edit the Ride Content Type

Now, validate and edit the Ride in order to add a Relation (multiple) between the two Content Types.

Then link some Points Of Interests to a Ride in the Admin interface.

Ride view

Display the list of POI

By default, there are only 4 variables in a view: noLayout, viewbaseLayout, content and location.

It is possible to inject whatever variable you want in a specific view.

You will find more info here: How to use a custom controller to display a content item or location and View provider configuration.

Add a new parameter to your override rule

We have already set an override rule for ContentType Ride and we will need to modify it to use our own action injecting the list of Point of interest content. 

ezplatform.yml

 

Create your Point of interest line view

Now, we need to create the line view for Point of interest.

Declare a new override rule into your app/config/ezplatform.yml:

ezplatform.yml

Create your template for the line view of a Point of interest app/Resources/views/line/point_of_interest.htm.twig:

point_of_interest.html.twig

 

 

 

Tutorial path

2 Comments

  1.  

    Minor issues:

    1. There is some inconsistency in one example we are using double quotes and in the other single quote characters.
    2. Is this a good practice to add a dead code to examples ? {#<img src="images/lyon.png" class="img-responsive img-rounded" alt="">#} {#<p class="padding-box text-justify"></p>#}

     

  2. Is it possible to get full ride template file ?