drupal-8

Twig variables as references

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 09:16:01
问题 I'm trying to change a Twig variable via a php reference but I can't achieve that. I looked around and nor with Twig functions nor with Twig filters I could do what I want. Any idea how to do that? {% set hiding_options_classes = "default" %} {{ hiding_options_func(content.field_hiding_options, hiding_options_classes) }} {{ hiding_options_classes }} In my Twig extension file: public function hiding_options_func($hiding_options, &$hiding_options_classes) { $hiding_options_classes = "coucou"; }

Docker containers for Drupal environment not linked

拈花ヽ惹草 提交于 2021-01-29 08:56:20
问题 I'm learning Docker and experimenting by installing Drupal. The process is to create 2 containers with one running Apache and the other running MySQL. I have the following docker-compose.yml file: version: '3' services: d8: container_name: d8 image: drupal build: . ports: - "8585:80" links: - d8mysql:mysql d8mysql: container_name: d8mysql image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: password MYSQL_PASSWORD: password MYSQL_DATABASE: drupal MYSQL_USER: user ports: - "3306:3306

Drupal 8 add ajax form element after ajax callback

时光怂恿深爱的人放手 提交于 2021-01-27 11:43:37
问题 I am building a drupal form with multiple ajax enabled form elements. I have one select list that does an ajax callback after change. The problem is that it adds a new select list to the page, which is also ajax enabled. This does not seem to work, which seems logical to me because the ajax is actually bundled an added to the page so it is lost in the replacecommand. Is there anyone experienced with this, and does anyone have a solution ? This is my code /** * {@inheritdoc} */ public function

Drupal 8 add ajax form element after ajax callback

ⅰ亾dé卋堺 提交于 2021-01-27 11:39:57
问题 I am building a drupal form with multiple ajax enabled form elements. I have one select list that does an ajax callback after change. The problem is that it adds a new select list to the page, which is also ajax enabled. This does not seem to work, which seems logical to me because the ajax is actually bundled an added to the page so it is lost in the replacecommand. Is there anyone experienced with this, and does anyone have a solution ? This is my code /** * {@inheritdoc} */ public function

Migrate Drupal Local Environment to Docker/Container

安稳与你 提交于 2021-01-07 01:00:22
问题 Background I currently have a site that is built using gitlab, composer, vagrant (Drupal-VM) and virtual box, along with other tools like drush, blt, and lighting core. I am new containerization and docker and would like some help in spinning up local environment TL;DR From my understanding this means we pretty much spin up a ubuntu vbox that then install a "package" or vagrant box that contains all the tools needed for Drupal, then use blt to start the app. Then drush to handle interacting

Drupal Local Development Setup/Environment

我的未来我决定 提交于 2020-12-13 20:57:28
问题 Background I have been developing Drupal Sites for a little over 2 years now and I have noticed that my dev environments are not as user friendly and as simple as I have expected. The current process is we have a git repo where we store all the code, then we have a vagrant box setup as our virtual machine to run our local development in. The issue comes along with the fact of constantly having to go through loop holes of trying to get everything to work well together. Or there will be issues