drupal-8

How to restore default homepage?

旧时模样 提交于 2019-12-23 03:32:35
问题 I'm new to Drupal, and cannot understand how to do this: I must have accidentally deleted the default home page in my test site, and cannot find a way to restore it. I see I can create a new basic page and set it as my new home, however this is missing something - for example it does not show latest articles with the "main page content" system block, even if I set this new page as the homepage in site settings. Should I do something more to let Drupal know this is actually an homepage? And

Why this json Symfony output outputs the headers

百般思念 提交于 2019-12-23 02:29:27
问题 This is my first day to have fun with Symfony and drupal 8, so please excuse me if my question is very obvious. With drupal 7: drupal_json_output(array('products' => array_values($products))); exit; the json output is clean: {"products":["item_1","item_2",....]} With drupal 8: use Symfony\Component\HttpFoundation\JsonResponse; // some process print new JsonResponse(array('products' => array_values($products))); exit; It outputs with the headers: HTTP/1.0 200 OK Cache-Control: no-cache Content

Why this json Symfony output outputs the headers

Deadly 提交于 2019-12-23 02:29:08
问题 This is my first day to have fun with Symfony and drupal 8, so please excuse me if my question is very obvious. With drupal 7: drupal_json_output(array('products' => array_values($products))); exit; the json output is clean: {"products":["item_1","item_2",....]} With drupal 8: use Symfony\Component\HttpFoundation\JsonResponse; // some process print new JsonResponse(array('products' => array_values($products))); exit; It outputs with the headers: HTTP/1.0 200 OK Cache-Control: no-cache Content

Drupal 8's SMTP Authentication module could not connect to SMTP Host [closed]

£可爱£侵袭症+ 提交于 2019-12-23 01:54:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 months ago . I've found other threads online that deal with this specific problem, but none have helped. I have two questions: One with Drupal 8, the other with telnet. Background: A client is using a third party company to handle all of their emails. I manage a Drupal 8 site for them that sends some emails with PHP's mail(

How to set file usage on drupal 8?

喜夏-厌秋 提交于 2019-12-22 01:19:57
问题 How to set file usage on drupal 8 ? and how to use below methods in drupal 8? file_usage_add. file_usage_delete. file_usage_list 回答1: here i have added equivalent syntax for Drupal 7 and Drupal 8 file_usage_add -> \Drupal::service('file.usage')->add file_usage_delete -> \Drupal::service('file.usage')->delete file_usage_list -> \Drupal::service('file.usage')->listUsage //Add / Delete file usage $entity_type = 'node'; $entity_id = 1;//Node ID $fid = 1; // The file ID $file = \Drupal\file\Entity

Is Aegir drupal 8 compatible?

痞子三分冷 提交于 2019-12-21 05:01:15
问题 I don't find a clear answer on that matter. Can Aegir ( current 3.3 version ) work with drupal 8 sites ? 回答1: Absoultely, we have a lot of test D8 sites on Aegir 3.3 (we have a free SaaS service to test Drupal 8, based on Aegir). More generally, Aegir3 supports Drupal 8 since 3.1 I believe, and we wouldn't release a version that would break Drupal 8 support (I'm a maintainer of Aegir). 来源: https://stackoverflow.com/questions/35267828/is-aegir-drupal-8-compatible

Drupal 8 custom block (module) create twig template file

做~自己de王妃 提交于 2019-12-21 02:17:06
问题 I have a custom Module that creates a custom Block which has field elements. This all works fine but I need to theme this block. I have checked the other posts on here and tried with no luck. I have enabled twig debug and got theme suggestions. Still no luck. Can anyone please point me in the right direction. This is what I have so far: my_module/my_module.module // nothing related in here my_module/src/Plugin/Block/myModuleBlock.php <?php namespace Drupal\my_module\Plugin\Block; use Drupal

drupal 8 get taxonomy term value in node

て烟熏妆下的殇ゞ 提交于 2019-12-20 19:56:10
问题 Drupal\node\Entity\Node Object ( [in_preview] => [values:protected] => Array ( [vid] => Array ( [x-default] => 1 ) [langcode] => Array ( [x-default] => en ) [field_destination] => Array ( [x-default] => Array ( [0] => Array ( [target_id] => 2 ) ) ) Not able to get field_destination value directly. It's a taxonomy term attached with the content type. Any help appriciated. 回答1: To build on VJamie's answer. You will need to either set a use statement at the top of your script; use Drupal

How to update my view in Drupal 8 without going back to the first page?

别等时光非礼了梦想. 提交于 2019-12-20 04:30:32
问题 I'm trying to refresh my View in Drupal 8 without reloading the page with this code : (function ($, Drupal) { 'use strict'; setInterval(function() { $('.view-message-activity-stream-timeline-public').trigger('RefreshView'); }, 10000); })(jQuery, Drupal); My module : <?php /** * @file * Holds hook implementation for the Message Activity Stream module. */ use Drupal\Core\Entity\ContentEntityBase; use Drupal\group\Entity\Group; use Drupal\node\Entity\Node; use Drupal\comment\Entity\Comment; use

Virtual Host with MAMP

旧巷老猫 提交于 2019-12-20 04:23:18
问题 I installed Drupal 8 with MAMP. My MAMP preference number for Apache Port : 80 , Nginx Port: 80 and MySQL Port: 8889 In etc/hosts file, I add 127.0.0.1 mmcast.test In httpd.conf file, Listen 80 and uncomment the following line. # Virtual hosts Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf In httpd-vhosts.conf file, NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /Applications/MAMP/htdocs ServerName localhost </VirtualHost> <VirtualHost *:80> ServerName mmcast.test