How to post code in these forums?

By using 4 ticks to open/close the code block instead of 3:

```
Code
```

So, like this:

````
```
Code
```
````

Which you can post like:

`````
````
```
Code
```
````
`````

Which is:

``````
`````
````
```
Code
```
````
`````
``````

Could go on, but… you get the point :wink:

Inline code like this can be done with a single tick (so `like this`). Can get confusing because MODX uses the same ticks in properties, in which case you could also use 2 ticks like this: ``[[!getResources? &foo=`bar`]]``

For what’s called a “fenced” code block, for longer code, you need an equal number of ticks (at least 3), on a line of their own, to open and to close what’s known as a “fenced” code block. Creating and highlighting code blocks - GitHub Docs

This is also shown in the “About the Support category” topic, which is pinned and at the top of that category for new visitors.

4 Likes