Skip to content

Instantly share code, notes, and snippets.

View arfaram's full-sized avatar

Ramzi Arfaoui arfaram

View GitHub Profile
#Multisite configuration with two different PageLayout Content Type Templates
ezpublish:
siteaccess:
list:
- siteaccess1_name
- siteaccess2_name
match:
Map\Host:
www.site1.de: siteaccess1_name
www.site2.de: siteaccess2_name
@arfaram
arfaram / 1_eZPlatform.MD
Last active June 30, 2016 20:22
eZPlatform bundle configuration
@arfaram
arfaram / ezpublish_RichTextField_REST_API.sh
Last active July 17, 2017 15:25
RichText_REST_API_ezpublish
curl -i -X POST http://site.ezplatform.com/api/ezp/v2/content/objects --data @content.xml -H 'Content-Type:application/vnd.ez.api.ContentCreate+xml' -H 'Accept:application/xml' --user admin:publish
#REST API Tested with ezplatform 1.5 (using RichTextField )
@arfaram
arfaram / 1_ezplatform_configuration_using_varnish4_nginx1.10_memcached_php7.1
Last active December 30, 2016 14:45
ezplatform configuration using varnish4 , nginx1.10 and memcached
## nginx
Reference: doc/nginx/vhost.template within your ezplatform installation
## varnish4
Reference: doc/varnish/vcl/varnish4.vcl within your ezplatform installation
more info https://github.com/ramzi-arfaoui/ezplatform/tree/master/doc
In this example:
* nginx is Listen on port 8081
##PSR-0
$ composer init
$ mkdir -p vendor/rar/form/src/Form/Controller
$ nano vendor/rar/form/src/Form/Controller/Fields.php
<?php
$ namespace Form\Controller;
class Fields
<?php
/**
* eZPlatform (1.7 >): delete specific contenttype location children (see ContentTypeIdentifier and change with yours )
* run the script using : php app/console training:delete_locations PARENT-LOCATION-ID
*/
namespace AppBundle\Command;
use eZ\Publish\API\Repository\Values\Content\LocationQuery;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

Keybase proof

I hereby claim:

  • I am arfaram on github.
  • I am ramziarfaoui (https://keybase.io/ramziarfaoui) on keybase.
  • I have a public key whose fingerprint is 26C5 87A1 4EEC 92A7 1B56 42E5 9328 D369 4020 3649

To claim this, I am signing this object:

ezgmaplocation_field override

This steps show you how to override the "ezgmaplocation_field" and using your own Google map API Key.This is generally the steps how to override an eZPublish5.x/eZPlatform standard FieldType template

  • Define the block Template in ezplatform.yml. In this example the content_fields.html.twig is located in the app/Resources/view folder
  • Override (copie/paste) the default template located in eZ/Bundle/EzPublishCoreBundle/Resources/views/content_fields.html.twig. We've added the global twig variable {{ gmap_key }} in the Google API URL
  • Add your Google API KEY as a Twig global vailable in config.yml

You should activate 2 API in your google project so that the map works for frontend and backend as well Activate following google API:

Set right Permission:

//Best Practice user ID in parameters.yml 
//@deprecated since 6.6 to be removed:
//$repository->setCurrentUser($repository->getUserService()->loadUserByLogin( 'admin' ));
//$repository->setCurrentUser( $repository->getUserService()->loadUser( 14 ) );
Use now:
$repository->getPermissionResolver()->setCurrentUserReference( $repository->getUserService()->loadUser( 14 ) );