WP as Headless CMS for React like Kentico/Umbraco
-
Hello!
I am looking for the correct resources to accomplish my task as I have been going around in circles trying to find the best solutions. I am making a basic e-commerce website with a React front end and want to use WordPress as a headless CMS but I do not understand how utilize pages, blocks, posts in WordPress to get usable JSON.
For example….I want to be able to retrieve wordpress CMS JSON for the homepage but the content value does not discern which values are intended to be the hero-title, hero-subtitle, hero-image, etc. and just lumps them all together as HTML under “content”. I don’t understand how to make custom fields in pages and have that reflected in the wordpress GUI (for marketers) so I can easily access the WP API in React. Ideally I can just call an endpoint like
GET https://www.sitename.com/wp-json/wp/v2/pages/2
and include fields such as
“hero-title”, “hero-subtitle”, “hero-image”, etc.
instead of having them all lumped into the “content” field.Same for FAQs…ideally I could
GET https://www.sitename.com/wp-json/wp/v2/pages/<FAQ_page_id>
and retrieve JSON with a field for FAQs with the following structure
faqs: {q1: a1, q2: a2, …}Are these fields supposed to be post types? Should I be categorizing posts as FAQs or as hero-titles? But then how do I link them to pages since posts seem to exist on their own? And would that mean I need to make an individual post for each subtitle/title/etc…that seems excessive. Or is this a taxonomy thing? I’ve installed the Custom Post Type UI but I can’t find a way to actually create instances of the custom post types and link them to a specific page?
I am used to CMS like Umbraco or Kentico and have no idea how to navigate WordPress since it tries so hard to auto-layout things. I just want to emulate Umbraco or Kentico in wordpress and use React to make API calls.
Thanks for reading…I’m so lost and frustrated. Any links/video tutorials would be appreciated. Or should I just completely move away from wordpress?
- The topic ‘WP as Headless CMS for React like Kentico/Umbraco’ is closed to new replies.