@arc-core-components/content-source_site-service-v3
v0.2.3-beta.0
Published
Content source that hooks into the Site Service portion of the Arc Suite.
Downloads
86
Maintainers
Keywords
Readme
Content Source: Site Service, v3 endpoint
This the Arc Core Component representing a content source that hooks into the Site Service portion of the Arc Suite and returns a feed of sites associated with a particular website.
The most important part is the pattern. This defines the endpoint that PageBuilder Fusion uses to look up content.
This Core Component takes advantage of PageBuilder Fusion's ability to use CONTENT_BASE to define the credentials for the Site Service, ensuring that no private secrets are exposed.
Pattern:
/site/v3/navigation/${serviceSite}/?hierarchy=${key.hierarchy || "default"}&_id=${key.section}
Parameters:
This content source takes three parameters:
- serviceSite - this is the Arc-Site.
- hierarchy - the hierarchy you would like to return a list of sites for. If not
supplied, this falls back to
default
, which gives the top-level list of sites. - section - If included, this will return sections beneath a specific section.
Getting started
This Core Component must be used within a Fusion project.
- Add this schema as a dependency of the repo.
npm install @arc-core-components/content-source_site-service-v3
- Create a file of your desired content source name within the
/content/sources
folder. For this content source, the suggested name issite-service-v3.js
- This is the name you should use when referencing this content source in any content config within a custom field.
- Paste the following into
site-service-v3.js
:
import source from "@arc-core-components/content-source_site-service-v3";
export default source;
Using this content source with a schema
You'll want to set a schema for this within your Component Repo. Look here for an example schema.