Skip to content

Instantly share code, notes, and snippets.

View bdunogier's full-sized avatar

Bertrand Dunogier bdunogier

View GitHub Profile
@bdunogier
bdunogier / README.md
Created November 30, 2021 16:29
IBEXA DXP: different user content type for registration per siteaccess

Ibexa DXP has allowed multiple user content types for a while now, but there is no documented, native way to change the user content type used for registration based on the siteaccess.

image

As it turns out, it is quite easy with a bit of tweaking.

The EzSystems\EzPlatformUser\ConfigResolver\ConfigurableRegistrationContentTypeLoader service is used by the registration process to provide the user content type used for

ArticleContentConnection:
type: relay-connection
inherits:
- DomainContentByIdentifierConnection
config:
nodeType: ArticleContent
curl -v -X POST \
   https://localhost:8000/graphql \
   -H 'Cookie: eZSESSID21232f297a57a5a743894a0e4a801fc3=3p30i5bu4h8seeu6avubimdj4c; eZSESSID98defd6ee70dfb1dea416cecdf391f58=igsqlrp39miio4h4a1ddc7b1et' \
   -F 'operations={"query":"mutation CreateImage($name: String!, $alternativeText: String!, $file: FileUpload!) { createImage( parentLocationId: 51, input: { name: $name, image: {name: \"Son-Gohan\", alternativeText: $alternativeText, file: $file} } ) { _info { id mainLocationId } name image { fileName alternativeText uri } } }","variables":{"file": null, "name": "Gohan", "alternativeText": "Final cell battle"}}' \
   -F 'map={"0":["variables.file"]}' \
   -F "0"=@/Users/bdunogier/Documents/Capture\ d’écran\ 2019-03-07\ à\ 00.50.42.png
@bdunogier
bdunogier / request.txt
Created September 25, 2018 07:41
eZ Platform GraphQL: domain articles with body and image
{
content
{
articles(query: { Created: { after: "yesterday" } })
{
title { text }
body { html }
image {
alternativeText
variations(identifier: "large") { uri}
@bdunogier
bdunogier / request.txt
Created September 24, 2018 08:56
eZ Platform GraphQL query with html rendering of a landing page field
{
# "Places & tastes" landing page on ezplatform-ee-demo
content(id: 236) {
fields {
value {
html
}
}
}
}
function md2word () {
pandoc -o $2 -f markdown -t docx $1
}
function word2md () {
pandoc -o $2 -f docx -t markdown $1
}
@bdunogier
bdunogier / politoscope-comparaison-mentions-media.md
Created April 20, 2017 09:08
Utilisation des données du politoscope (https://presidentielle2017.politoscope.org/dashboard) afin de comparer les mentions mediatiques des candidats.

Themes

  • emploi
  • economie
  • democratie
  • recherche_et_education
  • immigration_et_multiculturalisme
  • sante
  • ecologie
  • politique_energetique
  • politique_etrangere
@bdunogier
bdunogier / ezplatform_developer.dic
Last active March 16, 2017 11:44
Words added overtime to my PhpStorm spelling dictionary as an eZ Platform Core developer
behat
ezimage
ezplatform
ezpublish
ezrepoforms
ezsystems
fieldtypes
initializable
navigationhub
pagelayout
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@bdunogier
bdunogier / Howto-eZ-Platform-In-Context-with-Crowdin.md
Last active December 16, 2016 14:54
Translating eZ Platform in-context using Crowdin.com

Crowdin In-Context integration

This guide explains how to translate the eZ Platform UI in-context, within the application itself. It uses crowdin.com, and requires eZ Platform 1.7.0, released on december 15th.

  • Edit vendor/willdurand/js-translation-bundle/Bazinga/Bundle/JsTranslationBundle/Controller/Controller.php:198, change {2} to {3}.
  • Download the ezplatform-ach-ug-translations-tgz file from this gist.
  • Unzip it from app/Resources/translations. Create the directory if it doesn't exist. You should have three new directories: EzPublishCoreBundle, EzSystemsPlatformUIBundle and EzSystemsRepositoryFormsBundle.
  • Edit vendor/ezsystems/platform-ui-bundle/Resources/views/PlatformUI/shell.html.twig, and add this block right before