Skip to content

best-practices: set folder menu settings and find unpublished sites - #2

Merged
fmontes merged 3 commits into
mainfrom
best-practices-folder-menu
Nov 26, 2026
Merged

fmontes merged 3 commits into
mainfrom
best-practices-folder-menu

Conversation

@fmontes

@fmontes fmontes commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Two fixes to dotcms-best-practices, reference/core/01-site.md, found while running the "create a site from an existing one" use case against a multi-site estate.

Folders and the menu

Folders created with default settings are not on the menu: Show on Menu off, no title, sort order 0. A copied site then renders with an empty header. The endpoint that sets these, POST/PUT /api/v1/assets/folders, is not in the MCP server's bundled API spec, so the agent can't find it with search. /api/v1/folder has no update.

  • New "Folders and the menu" section. The menu is what the Navigation API returns ($navtool.getNav(), GET /api/v1/nav). The agent reads the model site's menu with GET /api/v1/nav/?depth=2&host_id=<siteId>. Because the Navigation API is read-only, it sets each folder's title, Show on Menu and Sort Order through /api/v1/assets/folders, called with execute.
  • "Done when" checks the new site's menu with the same Navigation API call. Tested: it needs depth=2 and host_id, and it works on an unpublished site.
  • SKILL.md "Also worth checking" gets a "Menu is empty" row.

Before: the agent tried PUT /api/v1/folder, which doesn't exist, and handed the menu to a person. After: in three runs out of three (Claude Code with Opus, and VS Code with Copilot on Sonnet) it set the folder titles, Show on Menu and sort order to match the source site, and the menu rendered in every language.

Site lookup

The lookup was GET /api/v1/site with perPage. Two problems:

  • perPage is ignored; the parameter is per_page. Without it only 10 sites come back.
  • The plain call skips unpublished (stopped) sites, so a re-run can't find the site it just created. archive=false returns active and unpublished sites; archive=true returns only archived ones.

The lookup is now GET /api/v1/site?per_page=100&archive=false, in the steps and in "Done when".

Related: dotCMS/core#38739 (the MCP page tools have the same unpublished-site lookup bug).

🤖 Generated with Claude Code

fmontes and others added 3 commits November 25, 2026 17:24
Folders created with default settings are not on the menu, so a folder-driven
VTL menu renders empty with HTTP 200. The endpoint that sets title, Show on
Menu and Sort Order is not in the MCP's bundled spec, and /api/v1/folder has
no update, so agents copying a site left the menu empty. Unwraps 01-site.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perPage is ignored (default page of 10 sites), and the plain listing skips
unpublished sites, so a re-run missed the site it had just created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fmontes
fmontes merged commit 895ba10 into main Nov 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant