Access CMS Content from JSON
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Access CMS Content from JSON
Code: Select all
Php version: 8.2.15
Versions:
aimeos/ai-laravel 2023.10.5
aimeos/aimeos-laravel 2023.10.8
inertiajs/inertia-laravel v0.6.11
laravel/framework v10.48.3
laravel/jetstream v4.3.1
laravel/serializable-closure v1.3.3
spatie/laravel-ignition 2.4.2
OS version: MacOs 14.4
Re: Access CMS Content from JSON
Do you need the CMS content in the frontend or backend?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: Access CMS Content from JSON
I'm thinking on the front end. We are building our own front end, but would love to be able to do small managed bits of content on the site that is edited by the admins.
Re: Access CMS Content from JSON
For the frontend, you have to use the frontend JSON API:
https://aimeos.org/docs/latest/frontend/jsonapi/basics/
The resource is "cms", e.g. "http://localhost:8000/jsonapi/cms" and to get the content too, you need to include the text resources:
http://localhost:8000/jsonapi/cms?include=text
or more specific:
http://localhost:8000/jsonapi/cms?include=cms.text
See also: https://aimeos.org/docs/latest/frontend ... gn-domains
https://aimeos.org/docs/latest/frontend/jsonapi/basics/
The resource is "cms", e.g. "http://localhost:8000/jsonapi/cms" and to get the content too, you need to include the text resources:
http://localhost:8000/jsonapi/cms?include=text
or more specific:
http://localhost:8000/jsonapi/cms?include=cms.text
See also: https://aimeos.org/docs/latest/frontend ... gn-domains
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: Access CMS Content from JSON
Thanks for the information. The first URL works great, especially if I have an ID, I can get the specific content.
The second URL: "http://localhost:8000/jsonapi/cms?include=cms.text" doesn't seem to return anything different. You had said "more specifc", but I'm not following what it was supposed to do?
The second URL: "http://localhost:8000/jsonapi/cms?include=cms.text" doesn't seem to return anything different. You had said "more specifc", but I'm not following what it was supposed to do?
Re: Access CMS Content from JSON
There was a bug in processing "cms.text" which is now fixed in the latest 2023.10 version of the aimeos/ai-cms-grapesjs package.
For CMS items it makes no difference but for e.g. products, it will returns only product texts if you specify "attribute,catalog,supplier,product.text" instead of the text items from the other related domains too.
For CMS items it makes no difference but for e.g. products, it will returns only product texts if you specify "attribute,catalog,supplier,product.text" instead of the text items from the other related domains too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: Access CMS Content from JSON
Got it, that makes sense.