Cockpit-HQ / Cockpit

Cockpit Core - Content Platform
https://getcockpit.com
Other
388 stars 47 forks source link

[Feature] Technical ID for a page #180

Closed pozylon closed 7 months ago

pozylon commented 7 months ago

It would be awesome to have a technical id that can be set on a per-page base for developers, so I can fetch a certain page with an id like "forgot-password" or "home" and i don't have to take care of having slug's in sync.

Using the id of the page automatically set by cockpit comes with it's own issues, for example when I hardcode it in code and the page gets re-created.

aheinze commented 7 months ago

Can't you utilize the metada of a page for this?

image

And the use the pages api:

/api/pages/pages?filter={"_meta.customId":"MyId"}&limit=1
pozylon commented 7 months ago

Oh wow i didn't know that hidden meta option of the pages, it only shows up when i filter explicitly for it. Cool, that's it.