|
| 1 | +# Content Engine Documentation |
| 2 | + |
| 3 | +**Note**: Content Engine is currently beta and is invite-only. If you're interested in exploring and testing Content Engine, fill out an [interest form](https://docs.google.com/forms/d/e/1FAIpQLSeFKjb1i1t8dbXIQd35NDzoSNKpx_1nWuf72FXmbj9WYAqLYw/viewform). |
| 4 | + |
| 5 | +When using the WordPress API through WPGraphQL, pulling content from WordPress can be slow and cumbersome. Content Engine increases the speed from which your front-end applications retrieve WordPress content. |
| 6 | + |
| 7 | +Content Engine offers the following benefits over WPGraphQL: |
| 8 | +1. Content Engine uses a custom query language that’s faster than WPGraphQL |
| 9 | +2. Content Engine provides a logical, easy-to-use schema for content retrieval |
| 10 | + |
| 11 | +## Pre-requisites |
| 12 | + |
| 13 | +1. A free-tier WP Engine account is required to use Content Engine. If you do not have an account, please reach out to {insert help email for CE). |
| 14 | +2. A WordPress site with either posts, pages, or users. |
| 15 | + |
| 16 | +When you enroll in testing Content Engine, you'll receive an email with: |
| 17 | +- A PDF for getting started |
| 18 | +- A zip file with the Content Engine plugin |
| 19 | +- Your Atlas URL and Access Token |
| 20 | + |
| 21 | +## Install the Content Engine plugin |
| 22 | + |
| 23 | +Content Engine, like other WordPress customizations, uses a plugin to enable its use. |
| 24 | + |
| 25 | +1. In your WordPress control panel, install the **Atlas Content Engine** plugin. |
| 26 | +2. Install and activate the plugin on the WordPress instance you want to enable. After activation, **WPE Content Engine** appears in the side panel. |
| 27 | +3. On the WPE Content Engine settings, set the following: |
| 28 | + - URL: https://aql.wpengine.com/sync/:site/graphql |
| 29 | + - Access Token: See the email sent to you during enrollment. |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +## Sync content for the first time |
| 34 | + |
| 35 | +With Content Engine fully integrated into your WordPress instance, you can sync your data with WordPress CLI. Open a terminal on the WordPress instance and enter `wp ce sync data`. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +Content Engine then syncs users, posts, and pages. Upon completion, CLI returns a message `Success syncing all data`. |
| 40 | + |
| 41 | +If you do not receive this message, ensure that your access token is set correctly and that the Content Engine plugin is installed. |
| 42 | + |
| 43 | +With your data synced, you can begin to query your data with Atlas Query Language. |
| 44 | + |
| 45 | + |
| 46 | +## Atlas Query Language |
| 47 | + |
| 48 | +Atlas Query Language (AQL) provides an intuitive schema for modern javascript developers and can retrieve content with low latency and high throughput, ensuring maximization for a site's SEO and user experience. |
| 49 | + |
| 50 | +## Use AQL |
| 51 | + |
| 52 | +To begin querying data with AQL: |
| 53 | + |
| 54 | +1. Navigate to your site's AQL URL, https://aql.wpengine.com/sites/:site/graphql. Replace `site:` with your site’s name. |
| 55 | + |
| 56 | +2. Upon entering the endpoint, the GraphQL console appears. Use the following query to sync posts from your WordPress instance: |
| 57 | + |
| 58 | + ``` |
| 59 | + query { |
| 60 | + posts { |
| 61 | + wpID |
| 62 | + slug |
| 63 | + title |
| 64 | + excerpt |
| 65 | + urlPath |
| 66 | + author { |
| 67 | + displayName |
| 68 | + avatar { |
| 69 | + url |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | + } |
| 74 | + ``` |
| 75 | + |
| 76 | +3. Select the **Play** icon to begin querying. All post data will show in a JSON format, which includes all metadata related to each post. |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +## Available Content |
| 81 | + |
| 82 | + |
| 83 | +Currently, Content Engine supports retrieval for the following: |
| 84 | + |
| 85 | +- Posts |
| 86 | +- Pages |
| 87 | +- Users |
| 88 | + |
| 89 | +As Content Engine matures, more WordPress content will become available. If you have suggestions for what type of content you would like to see, fill out this [feedback form](https://docs.google.com/forms/d/e/1FAIpQLSecvuZ_EMiTIOlTSwcW1JnPQcFbAcCOwGlhURkzBI8Ps9vFzA/viewform). |
| 90 | + |
| 91 | +## Feedback |
| 92 | + |
| 93 | +- **Questions? ** Email us [email protected] |
| 94 | +- **Feedback**: Your feedback helps shape the future of Content Engine. To provide feedback, fill out our [Content Engine Feedback Form](https://docs.google.com/forms/d/e/1FAIpQLSecvuZ_EMiTIOlTSwcW1JnPQcFbAcCOwGlhURkzBI8Ps9vFzA/viewform). |
| 95 | + |
| 96 | + |
0 commit comments