API Sitemap - maxgrafik/violetCMS GitHub Wiki

Data structure

[
    {
        url: <url>,
        title: <string>,
        published: <boolean>,
        publishDate: <ISO date string> | null,
        unpublishDate: <ISO date string> | null,
        visible: <boolean>,
        children: [...]
    },
    ...
]

GET

q=sitemap

POST

q=sitemap&action=<action> Depending on the action parameter you provide different data.

Actions

create

{
    title: <string>,
    slug: <string>,
    template: <string>,
    visible: <boolean>,
    published: <boolean>
}

Creates a new node in the sitemap and the corresponding page. Returns the updated sitemap.

move

{
    source: <url>, (url of page to move)
    target: <url>, (url of [new] parent)
    index : <int> (new position within target)
}

Moves the given node (including all child nodes) in the sitemap. Returns the updated sitemap.

delete

{
    url: <url> (url of page to delete)
}

Deletes the given node (including all child nodes) from the sitemap along with the page. Returns the updated sitemap.

⚠️ **GitHub.com Fallback** ⚠️