Skip to content

Ready-made solutions

This section is for ready-made solutions to various MODX-related tasks and issues.

How to add a solution

First, fork the project repository. The process is described in: Recommended way to contribute to the documentation. After that, return here and continue.

Category

In the left sidebar on this page you see the list of existing categories. If one of them fits, go to the next section.

Otherwise, in the file docs/faq/categories.json (from the repo root) add an entry like: "folder": "Menu text". For example:

json
{
  "ace": "Ace",
  "tinymce-rte": "TinyMCE Rich Text Editor",
  "useful-queries": "Useful query collection"
}

Writing your solution

Create your file at docs/faq/useful-queries/your-file-name.md (or the category folder you chose).

Подсказка

If you are running the site locally, restart the dev server so VitePress picks up config changes.

Then write your solution in that file using markdown and VitePress features.

Setting authorship

Add your authorship by following these instructions, and add the author property at the top of the file.

markdown
---
author: github-login // [!code ++]
---

# My ready-made solution

This solution is very useful and I'm sharing it with the community

If your solution was published elsewhere (e.g. your blog or on modx.pro), you can set a canonical URL.

markdown
---
author: github-login
head: 
  - - link // [!code ++]
    - rel: canonical // [!code ++]
      href: https://modx.pro/solutions/24050 // [!code ++]
---

# My ready-made solution

This solution is very useful and I'm sharing it with the community

Moderation

Then open a Pull Request (PR) and wait for review. After moderation and merge, your solution will be available on the site.

Thank you for contributing to the community, and good luck with tests, fewer bugs and sane SEO on your way 😉