Using partials as a snippets

Hello, everyone.

We are developing a theme, and we use a lot of Partials in it, but we have a question: can we use them as Snippets from the admin page?

So that, for example, our content managers could use them to quickly assemble a page.

No, that is not possible in Ghost. The snippets in the post/page editors are scoped to the editor and the partials are scoped to the theme.

If you need different looking pages, you could use custom templates that you prebuild for them:

Though, this does also not give them full freedom.

Can we hardcode some snippets?

Cuz we looking for custom blocks for building pages

You can prepare some HTML cards as snippets inside the editor.

My question is whether we can define some snippets without the editor in the admin panel, right in the theme, so that our copywriters just use the snippets we provide, itโ€™s just not very convenient to do a lot of snippets through the editor.

No, as I said. Snippets are scoped to the editor, partials to the themes.

There is no technical way to get anything from the theme into the editor, including snippets.

This might be useful? Or not!

(Edited to add: Since 2FA is coming, authenticating at this endpoint with a cookie is going to stop working at some point. If youโ€™re developing something that requires it, you might want to put in PR to make that endpoint accessible via api key.)

1 Like