psmb/ajaxify

Last activity on 6 June 2020
  • 13
  • 5
  • 4170
composer require psmb/ajaxify

Lazily load any content on your Neos site

0.5

Lazily load any content on your Neos site

Version
0.5
Type
neos-package
Release Date
03.06.2020 11:51:11
Source
git
Distribution
zip
Requires
Requires (dev)
None
Suggest
None
Provides
None
Conflicts
None
Replaces
None
LGPL-3.0+ 49338103ea06724faab23cc37e5fd25abbbf5ff0

Psmb.Ajaxify

This package allows you to mark any part of page for asynchronous loading via AJAX with just one line of Fusion code. Why? It helps you to speed up initial page load by delaying the load of some less relevant parts of the page, e.g. comments.

demo

TL;DR

  1. Install the package
composer require psmb/ajaxify
  1. Add @process.myUniqueKey = Psmb.Ajaxify:Ajaxify on any Fusion path. The myUniqueKey key of the processor MUST be globally unique.

  2. Add this anywhere in your Fusion code to include the sample AJAX loading script:

prototype(Neos.Neos:Page).head.ajaxLoader = Psmb.Ajaxify:CssTag
prototype(Neos.Neos:Page).body.javascripts.ajax = Psmb.Ajaxify:JsTag

Or include these assets via your build tool. Or just write your own loader.

  1. Done. Now part of your pages will be lazily loaded via an AJAX request.

Note: the Fusion component should not depend on any context variables, other than the standard ones. If you want to reuse some EEL expression in your code base, don't put it into context, rather wrap it into Neos.Fusion:Value object and use it everywhere you like.

  1. You may override the Psmb.Ajaxify:Loader object in order to customize the loader.

Usage in the Wild

The content of the readme is provided by Github
The same vendor provides 13 package(s).