Getting Node with Ajax

Hey,

can I get a node via an JS-Ajax-Call, and how can i setup this behaviour?
I have a list of blog-entries. On page-load there will be displayed 3 blog-entries and when I scroll down I want to load the next blog-entries dynamically. Also I would like to add an author-filter, which should work dynamically without reloading the page.

Thanks for your help!
Damian

Hey @damianthepichler,

I would create a new route, which gives you the required nodes as JSON. Have a look at the Neos.Seo package for example

  1. Create a Routes.yaml file in your Packages Configuration folder. (Neos.Seo/Configuration/Routes.yaml).
  2. Add your Routes in the Settings file (Neos.Seo/Configuration/Settings.yaml) and update the required variables.
  3. Add a fusion file to render your required data (Neos.Seo/…/XmlSitemap.fusion)

For the Fusion part: Simply render your entries as Neos.Fusion:DataStructure and run a @process.toJSON = ${Json.stringify(value} at the end

1 Like