文章

gin theme Link list Example

 <div class="panel gin-layer-wrapper">     <div class="node-type-list admin-list panel__content gin-layer-wrapper">         <div class="admin-item">             Homepage<a class="admin-item__link" href="/cms/web/node/add/homepage" title="Homepage">_</a>         </div>     </div>     <div class="node-type-list admin-list panel__content gin-layer-wrapper">         <div class="admin-item">             Homepage<a class="admin-item__link" href="/cms/web/node/add/homepage" title="Homepage">_</a>         </div>     </div>     <div class="node-type-list admin-list panel__content gin-layer-wrapper">         <div class="admin-item">             Homepage<a class="ad...

deploy drupal to AWS server but 404 not found

  Thanks Gisle. I had this situation, and found that Apache ignored my .htaccess file. For others in the same situation it could be helpfull to know how I sorted it out. I needed to make a change to the /etc/apache2/apache2.conf file in the following section: <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </ Directory > Change to: <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </ Directory > Save file, and restart apache server: sudo service apache2 restart By the way - if you search this topic you will find many that say you should edit the $url_path variable in settings.conf. However, this option has been deprecated since drupal 9. 

JS/PHP check wheather a url parameter exist

 <script> function isQueryParamPresent(param) {     // Assuming the URL we're checking is the current window location     const queryParams = new URLSearchParams(window.location.search);     // The `has` method returns true if the parameter is present     return queryParams.has(param); } console.log( isQueryParamPresent('hk') ); </script> =================================================== <?php function isQueryParamPresent($param) {     // Check if the parameter exists in the $_GET array     return isset($_GET[$param]); } $paramName = 'hk'; if (isQueryParamPresent($paramName)) {     echo "{$paramName} exists in the URL."; } else {     echo "{$paramName} does not exist in the URL."; }

SEO basic Tools

https://developers.facebook.com/tools/debug/ https://pagespeed.web.dev/ https://search.google.com/test/rich-results

[SEO] basic tag

 <meta property="og:image" content="https://_____" /> <meta property="og:image:width" content="1200" /> <meta property="og:image:height" content="630" /> og:type 標籤 : <meta property="og:type" content="網頁類型"> 用途 : 這個標籤描述了要分享的對象的類型。常見的類型包括 website (網站)、 article (文章)、 video.movie (電影視頻)等。它幫助社交媒體理解該內容的性質,從而更好地處理和顯示。 og:title 標籤 : <meta property="og:title" content="標題內容"> 用途 : 這個標籤指定了在社交媒體上分享時使用的標題。它通常是對網頁內容的簡短而精確的描述。這個標題會在分享連結時顯示,起到吸引用戶點擊的作用。 og:description 標籤 : <meta property="og:description" content="描述內容"> 用途 : 這個標籤提供了網頁內容的簡要描述,當連結被分享到社交媒體時,這段描述會顯示在連結下方。良好的描述能夠增加點擊率,吸引更多用戶關注。 <meta name=”description” content=”網頁內容敘述”> description &  og:description:兩種都要落 ------------------------------------------------------------------------------ Robots-拒絕檢索/索引 一般未特別處理的網頁,皆會被搜尋引擎爬蟲爬取,後續進行檢索與索引。但若有特殊頁面不希望被爬蟲爬取或顯示於搜尋結果頁上(ex. 開發中...

anynode View

 only 1  Contextual filters: Content: ID http://localhost/music_player/web/anynode/{node id}/?_format=json http://localhost/music_player/web/anynode/20/?_format=json http://localhost/music_player/web/anynode/21/?_format=json

drupal module Named Drupal Info Json with a json page to return base url

 Creating a Drupal module named "Drupal Info Json" that provides a JSON page to return the base URL of your Drupal site involves several steps. Below, I'll detail how to create this module in Drupal 9 or later, including all necessary files and configurations. Step 1: Create the Module Folder Start by creating a new folder for your module in the custom modules directory of your Drupal installation: Copy /modules/ custom/drupal_info_json Step 2: Create the .info.yml File Inside the drupal_info_json directory, create a file named drupal_info_json.info.yml . This file provides Drupal with metadata about your module. yaml Copy name: 'Drupal Info Json' type: module description: 'Provides a JSON response with the site base URL.' package: Custom core_version_requirement: ^8 || ^9 Step 3: Create the .routing.yml File Create a file named drupal_info_json.routing.yml in the same directory. This file will define the route to your JSON page. yam...