Help Center
The Help Center is the main tool our customers use to reach for support.
Development
The Help Center is a bit complicated because it runs in multiple different environments.
- In Calypso.
- In Simple sites
- as a plugin to Gutenberg editor.
- as a wpadminbar menu item.
- In Atomic sites
- as a plugin to Gutenberg editor.
- A plugin when the site is connected to Jetpack.
- A minimal plugin when the site is disconnected from Jetpack. This plugiy simple links to wp.com/help.
- as a wpadminbar menu item.
- A menu item that opens the Help Center when connected to Jetpack.
- A minimal plugin when the site is disconnected from Jetpack. This plugiy simple links to wp.com/help.
- as a plugin to Gutenberg editor.
How to debug the Help Center
In Calypso
Follow the classic Calypso development setup. Run yarn start and edit away. Nothing else should be needed.
In Simple sites
- cd into
apps/help-center. - run
yarn dev --sync. - Sandbox your site and
widgets.wp.com. - Your changes should be reflected on the site live.
In Atomic sites
If you only interested in making JS and CSS changes, you're in luck; you don't need to worry about running Jetpack. You can follow the same instructions of simple sites.
If you make changes to the *.asset.json files, i.e add or remove dependencies, these files won't be synced with the site as Jetpack pulls these files via network. And since Jetpack pulls from production and not your sandbox, you'll have to deploy first for these changes to take effect.
If you do want to modify PHP files. Please follow the development process of jetpack-mu-plugin.
Translations
Translation are uploaded to widgets.wp.com/help-center/languages. They're then downloaded in Jetpack during the build process.
Deployment
After every change to the Help Center, the development process is two parts:
Deploy Calypso
This simply means deploying Calypso as you normally would.
Deploy the Help Center for Jetpack consumption
- Connect to your sandbox and run:
install-plugin.sh hc --release - This will create a patch which you will need to land:
arc land - Deploy wpcom:
deploy wpcom
This will deploy the Help Center app for Jetpack consumption. Along with the languages files.
If you add new phrases to the Help Center. They will only be translated in Atomic sites after
jetpack-mu-pluginis released. Which happens twice a day.
Contextualized Support articles
Specify query per page/route
In route-to-query-mapping.json, there is a JSON structure where you can specify which search query Help Center should use based on the page URL/route.
Example
// This will use `home` as a search query when the user navigates to wordpress.com/home
"/home/": "home",
// This will use `new post` as a search query when the user navigates to {site}/wp-admin/post-new.php
"/wp-admin/post-new.php": "new post"
Suggest specific articles per page/route
In tailored-post-ids-mapping.json, there is a JSON structure where you can specify which post id ( one or many ) from which blog ( just one blog ) should be displayed
// This will fetch posts `"post_ids": [ 248292, 150414 ]` from `"blog_id": 9619154` and display them on `/home`
"/home/": [ { "locale": "en", "post_ids": [ 248292, 150414 ], "blog_id": 9619154 } ],
// This will fetch posts `"post_ids": [ 99385, 99879, 99982 ]` from `"blog_id": 33534099` and display them on `{site}/wp-admin/post-new.php`
"/wp-admin/post-new.php": [
{ "locale": "en", "post_ids": [ 99385, 99879, 99982 ], "blog_id": 33534099 }
]
Tailored articles have priority in the results, meaning they appear on top. If any search query is provided by the user, tailored articles are not considered.