文章

顯示從 1月, 2025 起發佈的文章

[Decoupled Preview drupal 11] iframe module

 To create a Drupal block module that embeds an iframe with the website Google.com, you'll need to go through several steps to properly set up the module, define a block, and ensure it integrates seamlessly within your Drupal site. Here’s how you can do this in Drupal 9 or Drupal 8: Step 1: Create the Module Folder and Files Create a new directory for your module in the modules/custom directory of your Drupal installation. Name your module, for example, iframe_google . Inside your iframe_google directory, create two files: iframe_google.info.yml iframe_google.module Create a src/Plugin/Block directory inside your module folder for your block plugin. Step 2: Define the Module Info File Add the following content to iframe_google.info.yml : name: 'Google Iframe Block' type: module description: 'Provides a block with an iframe displaying Google.' core_version_requirement: ^8 || ^9 package: Custom dependencies: - drupal:block Step 3: Define the...

drupal block module (hide content for Decoupled Preview drupal 11)

if specific content type add hide content css  To create a Drupal block module that includes a CSS file to set .node__content to display: none; , you will need to follow several steps. This involves creating a custom module, defining a block within that module, and adding a CSS file to the block. Here's a step-by-step guide to achieve this in Drupal (assuming you are using Drupal 9 or Drupal 8): Step 1: Create the Module Folder and Files Create a new directory for your module in the modules/custom directory of your Drupal installation. For example, name your module hide_node_content . Inside your hide_node_content directory, create two files: hide_node_content.info.yml hide_node_content.module Create a src/Plugin/Block directory inside your module folder for your block plugin. Step 2: Define the Module Info File Add the following content to hide_node_content.info.yml : name: 'Hide Node Content Block' type: module description: 'Provides a block ...

composer wamp multi version (when install module error)

 問題:我電腦有原先有一個wamp,但是PHP版本為5.5,不能滿足Laravel的版本需求,所以我重新下載了最新版的wamp,我安裝了最新版的wamp,用composer提示PHP版本低 解決方法: 我退出了原來的wamp,啟用最新的wamp(含php7),但還是不能用composer install初始化我的Laravel專案。 1) 在win cmd下執行php – version顯示為原來的版本5.5。好吧,其實已經有答案了,一開始沒有反應過來,這個5.5是因為我配置了環境變量,所以一直指向我原來的PHP目錄,導致composer失敗 2)解決方案:在我的电脑->属性->高级->环境变量中添加最新的PHP版本為環境變量,但是必須在之前環境變量的前面,當然也可以把之前的PHP環境變量刪除 3)重啟cmd或phpstorm運行composer install就可以了 143 You can change php version of composer without uninstalling it, follow these steps : Search for system environment variables in cortana. Click on the button "Environment variables". Under "System variables" select path and click on edit, you will see one entry like this "C:\wamp\bin\php\php5.6.13". Just change this to the folder name of the php located at your wamp/bin/php7.1.9, here php7.1.9 is folder name. Replace php5.6.13 with bin7.1.9, it will look like these "C:\wamp\bin\php\php7.1.9", just click ok on all the boxes. You are done. To verify, fi...

fix drupal 11 install error

  您好, 我發現了一個能夠在本機系統上安裝 Drupal 的調整: 在您網站的根資料夾中,有一個 .htaccess 文件,在編輯器中開啟它,然後將第 30 行周圍的行更改為 < IfModule mod_php.c > php_value assert . active 0 </ IfModule > 到 < IfModule mod_php.c > # php_value assert.active 0 </ IfModule > 在我的 XAMPP 本機系統上它可以工作。您可以再次安裝 Drupal。我用D10.3.10測試過。 安裝後,您可以再次編輯文件至舊版本。 C:\wamp64\www\my_site_name\web\core\assets\scaffold\files\htaccess

drupal (module) add content in content editor : paragraphs

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

smooth-scroll smooth scrollbar

 https://kontra.agency/smooth-scroll-the-setup-for-beginners/ https://github.com/idiotWu/smooth-scrollbar

API POST new content

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Post Comment </ title > </ head > < body >     < h1 > Post a Comment </ h1 >     < button onclick = " postComment ()" > Post Comment </ button >     < div id = "response" ></ div >     < script >         async function postComment () {             const url = '/cms/web/node?_format=json' ;             const data = {                 "type" : [                     {                         "target_id" : "cli...

[phpmyadmin import .sql error fix] no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration

  Open a php.ini file. and Find   upload_max_filesize   text. upload_max_filesize = 256M

jsonapi_page_limit

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

mysql workbench import .sql file

  Under  Server Administration  on the Home window select the server instance you want to restore database to (Create  New Server Instance  if doing it first time). Click on  Manage Import/Export Click on  Data Import/Restore  on the left side of the screen. Select  Import from Self-Contained File  radio button (right side of screen) Select the path of .sql Click  Start Import  button at the right bottom corner of window.