In this line of the apostrophe-templates module it states that a jquery get call will set the req.xhr
and as a result the refreshLayout.html
template will be used, which means you don't get the entire page.
However this seems restrictive and we need a way to override it, because what if I actually just wanted the entire page for say animation purposes, or crawling purposes using jquery?
As you know I am the lead developer of Apostrophe at P'unk Avenue.
It's easy to change the AJAX behavior. Just use a
pageBeforeSend
handler in any module to set a property inreq.data
and, in yourrefreshLayout.html
, use that as the argument toextend
.This is the same technique that allows your page templates or inner layout to extend either the outer layout or the ajax layout.