ล่าสุด Drupal คำถามที่เกี่ยวข้อง

คะแนน 1
How can I programmatically configure commerce checkout pane settings?
ธง us

In Commerce, we have custom pane and checkout configuration that applies to all orders. Per this d.o issue in commerce_features, this is supposedly doable. However, Commerce's default configuration always comes over.

In my feature that Feature creates, it generates the following code:

/**
 * @file
 * my_module_config.features.commerce_checkout_panes.inc
 * 
*/

/**
 * Implements hook_commerce_checkout_p ...
คะแนน 0
How to display the nodes with the reference entity "Group type" of the same type as the current group?
ธง cn

I have a website built with Drupal 9 and I installed the Group module.

I created a "Help" content type with an "Entity reference" field that refers to the group type.

enter image description here

I have created a Views page in the Groups tab and I want this page to display the "Help" nodes that reference the group type of the current group.

enter image description here

How to display the nodes with the reference entity "Type of group" of the same type, as the  ...

คะแนน 2
shyammakwana.me avatar
เชื่อมต่อฟิลด์กับ Taxonomy Term
ธง do

ฉันมีอนุกรมวิธาน ยี่ห้อ และสาขาต่างๆเช่น แกะ, เฝ้าสังเกต, 'CPU' ภายใต้ประเภทเนื้อหา ฮาร์ดแวร์.

ในขณะที่เพิ่มฮาร์ดแวร์ใหม่ ฉันจะเพิ่ม RAM, CPU หรือฟิลด์อื่ ...

คะแนน 4
non-existent service, yet cache is cleared and module is enabled
ธง ca

I'm trying to access a Drupal service for normalizing content, yet the service is non-existent, even though the module "hal" is enabled and the service is defined. How can I get the service "serializer.normalizer.entity.hal"?

root@0968b6d03cdb:/var/www/html# drush cr
 [success] Cache rebuild complete.

root@0968b6d03cdb:/var/www/html# drush pml|grep hal
  Web services                      HAL (hal)  ...
คะแนน 2
Get the time a custom block was last edited
ธง in
3x5

I have seen lots of answers for getting when a node was last edited, but I can't seem to apply any of these methods to blocks. Basically, I have a block that I only want to display if it has been updated in the last week. When I view blocks in the admin, I see that the admin view shows you when a block was last edited.

I can get my block in hook_preprocess_block, and get things like $block->lab ...

คะแนน 0
How to display group operations block not in a dropbottom menu either "normal" links list/HOOK_block_build_group_operations_alter does not fire
ธง fr

currently the links of the "group operations block" of group module are displayed in a dropbutton menu. I want them to get displayed in a "normal" link list. I found an issue (https://www.drupal.org/project/group/issues/3015420) related to this on d.o. I have already a custom module to handle my group stuff, so I thought to implement a block_build_alter hook to modify the link type like in the patch (

คะแนน 0
ฟิลด์ประเภทเนื้อหาเพื่อรวมเอนทิตีสื่อและลิงก์
ธง pl

ฉันยังใหม่กับ Drupal และฉันกำลังสร้างประเภทเนื้อหาใหม่ฉันรู้ว่ามี 2 ฟิลด์แยกกันสำหรับสื่อและลิงก์ แต่มีฟิลด์ที่มีทั้งสองฟิลด์หรือไม่ ตัวอย่างเช่ ...

คะแนน 0
Ivan Ginovski avatar
การคำนวณรอบภาษีตามคำสั่ง
ธง jp

เราจะปัดเศษภาษีให้เป็นทศนิยม 2 ตำแหน่งได้อย่างไร แต่ทศนิยมสุดท้ายควรเป็น 0 หรือ 5 ฉันมีกฎนี้สำหรับการปัดเศษ:

ถ้า ($ ทศนิยม % 10 <= 2) {
  // ที่นี่ ทศนิยมสุà ...
คะแนน 0
Lambic avatar
เขตข้อมูลอ้างอิงที่กำหนดเองบันทึกค่าว่าง
ธง ph

ฉันได้สร้างฟิลด์ที่กำหนดเองตามฟิลด์อ้างอิงเอนทิตี แต่ target_id ที่บันทึกนั้นมาจากระบบภายนอก

ฉันมีประเภทฟิลด์ วิดเจ็ตฟิลด์ และองค์ประกอบการเติมà ...

คะแนน 2
awm avatar
มีวิธีใดบ้างในการแก้ไข "ฟิลด์ node.field_name จำเป็นต้องอัปเดต"
ธง mx
awm

เมื่อรายงานสถานะของ Drupal แจ้งว่าฟิลด์ âfield_nameâ จำเป็นต้องอัปเดต ฉันพบว่าบางครั้งก็ยากที่จะแก้ไข เมื่อก่อนเราเคยมี เข้าร่วม แต่นั่นก็ถูกลบออกไป กาà ...

คะแนน 3
ฉันจะเพิ่มการพึ่งพาในโครงการที่แยกได้อย่างไร
ธง cn

ฉันพบข้อบกพร่องที่ต้องใช้โปรแกรมแก้ไข ผู้แต่ง.json.

มีแพตช์ในคิวปัญหา แต่ยังไม่ได้รวมเข้าด้วยกัน

ฉันจะอัปเดตผู้แต่ง json ของฉันให้ขึ้นอยู่กับเวอà ...

คะแนน 2
richirm avatar
รับไฟล์ URI ของ ImageItem
ธง in

ฉันจะรับไฟล์ URI ของไฟล์ Drupal\image\Plugin\Field\FieldType\ImageItem ตัวอย่าง?

ฉันได้รับค่าฟิลด์ด้วย $node_entity->get('field_image')[0] แต่ฉันไม่รู้วิธีรับไฟล์ URI

คะแนน 1
ไม่สามารถเข้าถึงไฟล์ใน /drupal/sites และ /drupal/themes หลังจากคืนค่าการติดตั้ง
ธง cn

ฉันกู้คืนไฟล์ของการติดตั้ง Drupal แล้ว แต่ฉันประสบปัญหา: ไม่สามารถเข้าถึงไฟล์ทั้งหมดใน /drupal/sites และ /drupal/themes ได้

ฉันพบข้อผิดพลาด 404 เท่านั้นเมื่อพยายามโหà ...

คะแนน 6
Joost avatar
ผิดไหมถ้าใช้เบ็ดตัวเดิมซ้ำ 2 ครั้ง?
ธง jp

ฉันกำลังทำงานโครงการที่ค่อนข้างใหญ่และฉันใช้ hook_entity_update () ในสามโมดูลของฉัน ฉันทำสิ่งนี้เพื่อให้โครงการมีโครงสร้างและมีฟังก์ชันต่างๆ ของไซต์ของ ...

คะแนน 2
liquidcms avatar
จะเพิ่มตัวเลือกการกำหนดค่าการรับรู้มุมมองไปยังตัวจัดรูปแบบฟิลด์ได้อย่างไร
ธง us

มีโมดูลตัวจัดรูปแบบฟิลด์ contrib (bg_img_formatter) ซึ่งมีตัวเลือกการกำหนดค่าฟิลด์มากมายหนึ่งในตัวเลือกเหล่านี้คือฟิลด์ข้อความซึ่งจำเป็นต้องอนุญาตให้มีการ ...

คะแนน 5
เนื้อหาตำแหน่งทางภูมิศาสตร์ของตัวกรองเพจเป็นบล็อก Views อย่างไร
ธง cn

ฉันมีเว็บไซต์ที่ใช้ Drupal 9 และโมดูล Geolocation :

https://www.drupal.org/project/geolocation

ฉันสร้างประเภทเนื้อหาด้วยฟิลด์ตำแหน่งทางภูมิศาสตร์ที่มีพิกัด

เว็บไซต์ของฉันใช้ธีม Olivero ฉันà ...

คะแนน 2
Carl avatar
ฉันจะปิดการใช้งานผลิตภัณฑ์เพื่อให้ไม่สามารถซื้อได้และแสดงในมุมมองได้อย่างไร
ธง cn

ฉันมีมุมมองของผลิตภัณฑ์ที่เผยแพร่ ฉันต้องการสร้างมุมมองของผลิตภัณฑ์ที่ไม่ได้เผยแพร่ด้วย เพื่อให้ผู้ใช้สามารถดูผลิตภัณฑ์ก่อนหน้านี้ที่มีอภ...

คะแนน 0
หลังจากอัปเดตจาก 9.2 เป็น 9.3 ไซต์ของฉันหยุดทำงาน แต่การปิดการรวม CSS/JS จะแก้ไขได้ ฉันจะเปลี่ยนอะไรได้บ้างเพื่อให้สามารถเปิดใช้อีกครั้งได้
ธง pk

หลังจากอัปเดตจาก 9.2 เป็น 9.3 ไซต์ของฉันหยุดทำงาน เมื่อฉันปิดการรวม CSS และ JavaScript มันจะแก้ไขไซต์เวอร์ชัน 9.3 ของฉัน ฉันต้องการเปิดใช้งานเนื่องจากจะทำให้ไ ...

คะแนน 0
Md. Shafiq Hossain avatar
Node form ajax dependent dropdown fields issue
ธง cn

I am using Drupal 9. I know how to change single dropdown list using another one. Here is my scenario:

I have three dropdowns, in node form - company, protocol and investigator. What I like to do, when some one select a value in company dropdown, other two dropdown list which change based on selection.

I have written some code, I see the list is updating but its not refreshing.

function hook_form_alter() {
 ...
คะแนน -1
Matoeil avatar
How do I sanitize the uploaded files name for sending safely as email attachments?
ธง za

I have create a form that upload a file. This file is send as email attachment

 ..
     $form['cv'] = [
          '#type' => 'managed_file',
          '#title' => 'Votre CV',
          '#required' => true,
          '#upload_validators' => [
            'file_validate_extensions' => ['pdf doc docx odt odf'],
            'file_validate_size' => 4000,
          ],
        ];
..

on form s ...

คะแนน 0
Joost avatar
Programmatically add Views block to field group
ธง jp

I want to programmatically add a view to a field group I created using the field_group module. I created an group_articles tab field group.

When I do this something like hook_form_alter:

    $form['issues__articles'] = array(
      '#type' => 'fieldgroup',
      '#weight' => 0,
    );
    $form['issues__articles']['view'] = [
      '#type' => 'view',
      '#name' => 'view_admin',
      '#displa ...
คะแนน 0
Tushar avatar
รับปัญหาในการนำเข้ามุมมอง?
ธง nz

ฉันได้ลบฟิลด์ความสัมพันธ์ของมุมมองโดยไม่ได้ตั้งใจ หลังจากนั้นฉันได้รับข้อผิดพลาดเมื่อพยายามเปิดหน้าการกำหนดค่ามุมมอง

เพื่อแก้ไขปัญหาฉัภ...

คะแนน 1
Jimmyb_1991 avatar
Can you install exported site config as part of a kernel test?
ธง cn

I am using the Configuration Sync module to export config specific to my site out into a config directory that lives outside my main Drupal directory.

When writing kernel tests I know that you can use $this->installConfig() and specify a module(s) to install default config from, but how can I specify certain (or all) config files from that directory to be installed inside of a kernel test?

คะแนน 2
quantumized avatar
เราจะสร้างผลรวมของค่าคอลัมน์ตารางของ View ในส่วนหัวและ/หรือส่วนท้ายได้อย่างไร
ธง ng

เรามีมุมมองที่มีแถวค่าเขตข้อมูลทศนิยมหลายแถว เราจำเป็นต้องสร้างผลรวม (เพิ่มค่าทั้งหมด) สำหรับคอลัมน์เหล่านี้ในส่วนหัวและ/หรือส่วนท้ายของมุมà ...

คะแนน 0
How to get the url of a link field in field.html.twig
ธง in

Inside the field--link.html.twig file, I'm trying to output the url from a link field like so:

{% for item in items %}
  <div{{ attributes.addClass(classes) }}><a class="button" href="{{ item.content.uri }}">Apply Now</a></div>
{% endfor %}

I've tried the following to get the url, and nothing seems to work.

  • item.content.uri,

  • item.content.uri,

  • item.content.url,

  • item.content.0.u ...

คะแนน 1
liquidcms avatar
How to get a rendered views field value programmatically?
ธง us

Yes, I see there are many answers already posted here and elsewhere for this; but sadly they are all wrong. These answers include any of the following:

$view->style_plugin->getFieldValue($rid, 'field_myfield');

foreach ($view->result as $rid => $row) {
 foreach ($view->field as $fid => $field ) {
   $values[$rid][$fid . '-value'] = $field->getValue($row);
   $values[$rid][$fid  ...
คะแนน -1
ฉันจะใช้ `NestedArray::getValue()` เพื่อรับค่าจากอาร์เรย์ได้อย่างไร
ธง et

ฉันเห็น NestedArray::getValue() แต่เอกสารไม่ชัดเจน ฉันจะใช้สิ่งนี้เพื่อรับค่าจากอาร์เรย์ที่ซ้อนกัน เช่น สถานะของฟอร์มหรืออินพุตของฟอร์มดิบได้อย่างไร

คะแนน 0
May  avatar
Ho can I add a class to a specific row in views-view-field template?
ธง zw

I have created a custom views-view-field template and added some custom html and views field similar to this

<div class="{{ fields.my_text_field.content }}">
  {{ fields.my_media_field.content }}
</div>

The trouble I am having is that I want to add classes on certain rows only. Similar to below

<div class="{{ fields.my_text_field.content }} not-row-2">
  {{ fields.my_media_field.co ...
คะแนน 2
Yuseferi avatar
เปิดใช้งานตัวปรับขนาดรูปภาพสำหรับรูปภาพทั้งหมดใน ckeditor
ธง cg

ฉันใช้ Drupal 9.2.9

ฉันมีเนื้อหาที่ย้ายบางส่วนซึ่งมาจากแหล่งภายนอก มีบางอย่าง <img แท็ก,

ตัวปรับขนาดรูปภาพ Ckeditor กำลังทำงานกับรูปภาพที่ฉันใส่ไอคอนอัปโหภ...

คะแนน 0
miststudent2011 avatar
How to create a View to display nodes with empty entity referenced fields
ธง fr

Can anyone please help me to create a view when entity referenced field is empty. I have a body field where various paragraph fields are referenced. I would like to get list of nodes whose body field is empty.

By default body field is entity referencing to one text paragraph. Even if it is not a required field.

Even thought the para is empty it is not being displayed in the results. If I remove defaul ...

พลังที่น่าทึ่งของคำถาม

วันทำงานส่วนใหญ่ของผู้บริหารหมดไปกับการขอข้อมูลจากผู้อื่น เช่น การร้องขอการอัปเดตสถานะจากหัวหน้าทีม หรือการซักถามเพื่อนร่วมงานในการเจรจาที่ตึงเครียด แต่ไม่เหมือนกับมืออาชีพ เช่น ทนายความ นักข่าว และแพทย์ ที่ได้รับการสอนวิธีถามคำถามซึ่งเป็นส่วนสำคัญของการฝึกอบรม ผู้บริหารเพียงไม่กี่คนที่คิดว่าการตั้งคำถามเป็นทักษะที่สามารถฝึกฝนได้ หรือพิจารณาว่าการตอบคำถามของตนเองจะทำให้ การสนทนามีประสิทธิผลมากขึ้น

นั่นเป็นโอกาสที่พลาดไป การตั้งคำถามเป็นเครื่องมืออันทรงพลังที่ไม่เหมือนใครในการปลดล็อกคุณค่าในองค์กร: กระตุ้นการเรียนรู้และแลกเปลี่ยนความคิดเห็น กระตุ้นนวัตกรรมและการปรับปรุงประสิทธิภาพ สร้างสายสัมพันธ์และความไว้วางใจระหว่างสมาชิกในทีม และยังช่วยลดความเสี่ยงทางธุรกิจได้ด้วยการเปิดโปงหลุมพรางและอันตรายที่คาดไม่ถึง

สำหรับบางคน การตั้งคำถามเกิดขึ้นได้ง่าย ความอยากรู้อยากเห็นตามธรรมชาติ ความฉลาดทางอารมณ์ และความสามารถในการอ่านใจคนทำให้พวกเขาถามคำถามในอุดมคติที่ปลายลิ้นของพวกเขา แต่พวกเราส่วนใหญ่ไม่ถามคำถามมากพอ และเราไม่ได้ตั้งคำถามด้วยวิธีที่เหมาะสมที่สุด

ข่าวดีก็คือโดยการถามคำถาม เราจะพัฒนาความฉลาดทางอารมณ์ของเราโดยธรรมชาติ ซึ่งจะทำให้เราเป็นนักตั้งคำถามที่ดีขึ้น ซึ่งเป็นวัฏจักรที่ดี ในบทความนี้ เราดึงข้อมูลเชิงลึกจากการวิจัยด้านพฤติกรรมศาสตร์เพื่อสำรวจว่าวิธีที่เรากำหนดกรอบคำถามและเลือกตอบคำถามของเราสามารถมีอิทธิพลต่อผลลัพธ์ของการสนทนาได้อย่างไร เราให้คำแนะนำในการเลือกประเภท โทนเสียง ลำดับ และกรอบคำถามที่ดีที่สุด และสำหรับการตัดสินใจว่าจะแบ่งปันข้อมูลใดและมากน้อยเพียงใดเพื่อเก็บเกี่ยวผลประโยชน์สูงสุดจากการโต้ตอบของเรา ไม่ใช่แค่เพื่อตัวเราเองแต่เพื่อองค์กรของเรา