> For the complete documentation index, see [llms.txt](https://benjaminzekavica.gitbook.io/gutenberg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://benjaminzekavica.gitbook.io/gutenberg/plugins/transform.md).

# Transform

Bei Gutenberg sieht man oft das Umwandeln Tool beim Auswählen eines Blocks. Diese Funktion macht die Arbeit in Gutenberg unheimlich effizient für die Redaktion.&#x20;

![Hier ein Beispiel vom sogenannten Transform Tool](/files/-LnNNePFJuTeymohN7ab)

### Let's code!

Innerhalb deines Blocks fügst du diese Zeilen Code hin. Danach erkläre ich dir das Schritt für Schritt.&#x20;

```jsx
// Dependencies 
import { registerBlockType } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n'; 
import { TextControl } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { createBlock } from '@wordpress/blocks';

// Füge dies innerhalb deiner registerBlockType() Funktion hinzu
 transforms: {

    // Anderen Block in unseren jetzigen umwandeln.
    from: [
        {
            type: 'block',
            blocks: [ 'core/paragraph', 'core/heading' ],

            transform: ( { content } ) => {
                return createBlock( 'prwp-blocks/transform', {
                    headline: content
                } );
            },
        },

        // Shortcut erstellen / Space(Leerzeichen) danach drücken
        {
            type: 'prefix', 
            prefix: '#prwp', 
            transform: ( ) => {
                return createBlock( 'prwp-blocks/transform');
            }
        }
    ], 

   // Jetzigen Block in einem anderen Block umwandeln
   to: [
        {
            type: 'block',
            blocks: [ 'core/heading'],
            transform: ( { headline } ) => {
                return(
                    createBlock( 'core/heading', {
                        content: headline
                    })
                )
            },
        }
    ]
 },
```

Bei dieser Funktion kannst du den Zustand aller Blöcke beeinflussen und deinen jetzigen Block quasi registrieren. Die sogenannten Namespaces habe ich dir alle unter [**Standardblocks**](/gutenberg/blocks/standardblocks.md) definiert.\
Innerhalb des Codes kannst du gerne die Kommentare lesen, die dir das Lesen erleichtert.  &#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://benjaminzekavica.gitbook.io/gutenberg/plugins/transform.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
