How to make /amp URL in Drupal 9?

Created on 3 June 2023, over 1 year ago
Updated 9 November 2023, over 1 year ago

Hello, is there a way to work /amp URLs in Drupal 9? We are trying to migrate our website from D7 to D9, and would like to know how to make our AMP URLs ending with /amp rather than with a question mark. Can you please help how to do this in Drupal 9?

💬 Support request
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States erku

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @erku
  • 🇮🇱Israel isaac888

    hey, did you found how to solve the issue?

  • Assigned to viren18febs
  • 🇮🇳India viren18febs

    Checking for steps!

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India viren18febs

    Hi @erku
    please follow one of these steps--

    If you are using custom source plugin for your migration script.
    Step 1 : Add preparerow function in your source plugin
    Step 2 : Fetch the sourceproperty from d7 $row variablr and add /amp instead of ? in you column.

    By using process plugin:
    Step 1 : Map the field in process and add a custom process plugin
    Step 2 : in transform function you have $row and $value.
    Step 3 : According to your condition add /amp instead of ?

  • 🇺🇸United States erku

    Hi everyone, I have a new issue, may be someone can help here.

    Hello Drupal developers. I have a problem, has to do with image size, Google Accelerated Mobile Pages (AMP) and Google Carousel for Top News. After upgrading from Drupal 7 to Drupal in in July, my website basically stopped appearing for Latest from Torque News as AMP pages when searching Torque News (my site). It stopped sending me AMP traffic, although AMP pages validate well. May be the problem has to do with image size. I am using Google required 16x9 ratio with minimum 1200 size, using 1200x675 size, which has worked great in the past Drupal 7. Now a few days ago I noticed that when I paste my articles (Example https://www.torquenews.com/14335/tesla-model-x-demand-increasing) to our Telegram page, it shows a very small size image (we don't have that size image style), but when I paste another successful site's article to our Telegram, it shows the right full size. My question: What am I doing wrong? Can you please look at the source code and tell me why Google and other search engines see the small size image and not the full size image. See the example in the attached screenshot from our Telegram. Our sample AMP page is https://www.torquenews.com/14335/tesla-model-x-demand-increasing/amp Thank you.

  • Status changed to Active over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024