• Resolved bruselee

    (@bruselee)


    I’m having a hard time developing gutenberg block.

    AMP is enabled in my WordPress plug-in, so that my posts have AMP Page and non-AMP

    The Gutenberg Block I developed is a search box that references custom scripts, which works well on non-AMP pages
    But this doesn’t work in AMP pages.I don’t know how to modify my Gutenberg block to support AMP

    Here is the core of my code, can someone tell me what to do?

    my-core-code

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @bruselee

    Thank you for contacting us, can you please share what you are trying to achieve with amp-scripts also can you please provide an example URL.

    Thread Starter bruselee

    (@bruselee)

    I want to customize the script through the amp-script tag to submit the information in my form to the server. Yes, I want my plug-in to complete the submission action on both anp and non-amp pages. Do you have any good ideas? Besides @milindmore22

    Plugin Support Milind More

    (@milindmore22)

    @bruselee
    Can you please send us the code snippet html+javascript of the non-AMP page in jsfiddle or in gist

    We will recommend using the form tag with the action-xhr attribute and avoid using the amp-script.

    You can learn more about amp-form using documentation

    You can also learn more about amp-script using documentation

    In case you are curious about amp-script you can check the mini plugin for example

    Plugin Support Milind More

    (@milindmore22)

    @bruselee As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How AMP forms are inserted into the Gutenberg Block Save function’ is closed to new replies.