Join the Webstudio community

Updated last month

Connecting to External CMS

At a glance
I'm a beginner in this area, and I have a question. In YouTube tutorials, connecting via the WordPress REST API or other external CMS (Data Variables) is usually done in the BODY. Does it have to be this way, or can the data source be added, for example, in a section of the page? Does this affect performance?
1
O
B
r
7 comments
its only a matter of where you want to access it, you want to define it close to where you use it or globally on body if its for the entire page
or on the root if its for every page
Only global root and body variables can be accessed from page settings
What does this mean in practice?
Does it matter where I place them in terms of website performance? And does the number of them make a difference? I'm asking about WordPress and the REST API. GraphQL, based on the WebStudio video on YouTube, seems a bit more complex to me.
If you need to bind that data in page settings, you will need to put it into body or root
My advice would be to start with one of the pre-built integrations. So if you're using Wordpress, use that one. Open Webstudio and start a new project. Then on the side select the integration from the marketplace. And generally i would recommend creating your queries on the body so they are all in one place and easy to find. Unless you have certain calls that are going to happen on every page (like a list of featured posts, or whatever). In that case create it on the root and it will easily be available on every page. In terms of performance I don't think it matters much if you call on the body or if you call later in the DOM. Either way it's getting called.
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord