Fetch landing contents by ID
2023-12-08 09:00 WIB - Hendrik Lie
Some of our pages used to contain published entries of type
post with a certain slug. It makes little
sense since by default posts with type post has no viewer
that uses slug as its URL. It makes even no sense that the
target post must be published.
If a post is of type post, it is not meant to be found
after all. After all, it does not matter on whether it is published or
not. It would be impossible to find one from public interface either
way.
It also hinders us in more ways than one, as we cannot rename the
title without causing our website to crash. Therefore fetching contents
to fill up landing page and about page (and any other page if it
matters) should use one property that should never change: its
UUID.
We have it already implemented, which enables us to freely rename the
title (as long as the title is unique) of posts used in our views,
without crashing our website. It also allows us to easily manage them
when we already have our admin page, as we can simply shift through all
posts, and select one that we want to appear by UUID.