Download the PHP package novactive/ezextrabundle without Composer
On this page you can find all versions of the php package novactive/ezextrabundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download novactive/ezextrabundle
More information about novactive/ezextrabundle
Files in novactive/ezextrabundle
Package ezextrabundle
Short Description Novactive eZ Platform Extra Bundle
License MIT
Homepage https://github.com/Novactive/NovaeZExtraBundle
Informations about the package ezextrabundle
Novactive Extra Bundle for eZ Publish Platform
This repository is what we call a "subtree split": a read-only copy of one directory of the main repository. It is used by Composer to allow developers to depend on specific bundles.
If you want to report or contribute, you should instead open your issue on the main repository: https://github.com/Novactive/Nova-eZPlatform-Bundles
Documentation is available in this repository via .md
files but also packaged here: https://novactive.github.io/Nova-eZPlatform-Bundles/master/ExtraBundle/README.md.html
Installation
Step 1: Download Nova eZExtra Bundle using composer
Add the lib to your composer.json, run composer require novactive/ezextrabundle
to refresh dependencies.
Step 2: Enable the bundle
Then inject the bundle in the bundles.php
of your application.
Step 3: Add the default routes
Activate the sroutes:
Step 4: Clear the cache and check
Go to : /_novaezextra/dev/test
Documentation
Twig Content Helper
eznova_parentcontent_by_contentinfo( content )
Note : you get the content of the parent on the main location
eznova_location_by_content( content )
eznova_relationlist_field_to_content_list( fieldValue )
Note : return an array of direct linked contents by the relation objects FieldType
eznova_is_rich_text_really_empty(richTextFieldValue)
Note : returns true if the value of RichText field is empty excluding the tags, whitespaces and line breaks, false otherwise
Twig Text Parsing Helper
ctaize
Note : Filter which converts the string like ezcontent://123 or ezlocation://234 to the URL of specified content or location
ezlinks
Note : Filter which fixes the mistakes in opening/closing div tags and converts string like ezlocation://234 to the URL of specified location
htmldecode
Note : Filter which applies html_entity_decode php function to the specified var
Twig Image Helper
get_image_tag(content, fieldIdentifier, variationAlias, params)
Generates the picture html code including images for original, retina and mobile screens specified in the image variations config like the following:
If the placeholder dimensions are specified with empty content and variation then the placeholder image will be displayed:
get_image_url(content, fieldIdentifier, variationAlias, params)
The same as previous but returning just an image URL instead of tag.
get_image_asset_content(field)
Returns the Content by the Image Asset field. Requires the eZ\Publish\API\Repository\Values\Content\Field to be specified.
IMPORTANT: The image placeholder is enabled by default but can be disabled by setting the bool value to _ENABLE_IMAGEPLACEHOLDER env variable.
Picture Controller
Content/Location Helper
The goal was to mimic the old Fetch Content List
public function contentTree( $parentLocationId, $typeIdentifiers = [], $sortClauses = [], $limit = null, $offset = 0, $additionnalCriterion );
public function contentList( $parentLocationId, $typeIdentifiers = [], $sortClauses = [], $limit = null, $offset = 0, $additionnalCriterion );
public function nextByAttribute( $locationId, $attributeIdentifier, $locale, $additionnalCriterions = [] );
public function nextByPriority( $locationId, $aditionnalCriterions = [] )
public function previousByAttribute( $locationId, $attributeIdentifier, $locale, $additionnalCriterion = [] )
public function previousByPriority( $locationId, $additionnalCriterion = [] )
public function getSelectionTextValue($content, $identifier)
Return an array of Result
Usage:
Children Provider
Simply inject the children ( and potentially other things on a view Full )
Add your provider in a folder of your bundle
You class YOUCONTENTIDENTIFIERPROVIDERCLASS must extend Novactive\Bundle\eZExtraBundle\EventListener\Type
After you need to create a method for each view you display if you want to get children in your template The goal is to have children on each view.
Ex:
RepositoryAware helper (trait)
Returns the list of reverse relations (RelationList) of the specified ContentInfo
RouterAware helper (trait)
public function generateRouteLocation(Location $location): string
public function generateRouteContent(Content $content): string
public function generateRouteWrapper(Wrapper $wrapper): string
The trait that allows to get the Route by location, content or Wrapper object.
ViewMatcher
This allows you to specify different ez views for the same content type but with different values of particular field.
IMPORTANT: By default the field name is set to matcher but can be rewritten by specifying it in the _VIEW_MATCHER_FIELD_IDENTIFIER_ env variable.
Then for example if you set the business value to the field that is set to identify the view (matcher by default) inside the Article Content Type then another template can be defined for that using the following config: