Skip to content

Conversation

@Fran-A-Dev
Copy link
Contributor

No description provided.

@Fran-A-Dev Fran-A-Dev marked this pull request as draft January 23, 2025 17:28
@Fran-A-Dev Fran-A-Dev changed the title added a how to setup cpt doc page Docs: how to setup cpt doc page Jan 23, 2025
@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt https://hr…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt https://hr…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

@Fran-A-Dev Fran-A-Dev marked this pull request as ready for review January 24, 2025 17:13
@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt https://hr…wered.com ✅ (logs)

Learn more about preview environments in our documentation.

Copy link
Member

@moonmeister moonmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, please add the appropriate redirect


If you haven't already, follow the [Basic Setup](/docs/how-to/basic-setup/) steps to get Faust.js set up.

### 2. Download ACF and WPGraphQL for ACF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's include these as part of the prereqs, along with the IDE plugin, as discussed. Maybe reword the prereqs to read: You need a WP instance and the next site. The WP needs plugins XYZ, and the next site needs the Basic Setup complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, @moonmeister the "Basic Setup" doc tells users to do all the setting up of WP instances and Next.js site etc etc. So I can just say do the basic setup and add the 3 plugins


Download the [Advanced Custom Fields](https://www.advancedcustomfields.com/download/) plugin and the [WPGraphQL for ACF](https://github.com/wp-graphql/wpgraphql-acf) plugin in your WordPress admin.

### 3\. Verify Your CPT Was Setup Properly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title says I'm verifying it, but you never told me to create a custom post type or gave links on how to do that. You go on to do that, but the verify seems misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I should rename that step "Create A CPT" then when I tell them to visit the link to verify it, that should be the "Verify" step.


![](images/cpt-gql-response-os.png)

Finally, let's check to see if the archive is accessible. Copy and paste this query into the GraphQL IDE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as the above query language


With possible types generated, we can now start creating Faust templates for our CPTs!

Before we begin, start the dev server in the Faust app with the dev command:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unneeded as of yet. Let's leave it till its critical

};
```

You now have a movie template registered to your Faust.js project. If you visit `http://localhost:3000/movies/office-space` again, you now will see the template resolve properly:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this a sperate step where we verify our template is working and have them start the dev server.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt N/A ❌ (logs)

Learn more about preview environments in our documentation.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt N/A ❌ (logs)

Learn more about preview environments in our documentation.

@Fran-A-Dev
Copy link
Contributor Author

@moonmeister made the suggested changes along with some re-structuring of steps and written text. Let me know what you think.

@headless-platform-by-wp-engine

Check out the recent updates to your Headless Platform preview environment:

App Environment URL Build
faustjs.org preview-env-docs/how-to-cpt N/A ❌ (logs)

Learn more about preview environments in our documentation.

@moonmeister moonmeister merged commit 7b3b24e into toolkit Jan 30, 2025
1 of 2 checks passed
@moonmeister moonmeister deleted the docs/how-to-cpt branch January 30, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants