Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

brandleadership/radiant-page-part-handling-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Radiant Page Part Handling Extension

Author Pascal Näf - Screen Concept
Contact: pascal.naef AT screenconcept DOT ch

About Page Part Handling Extension

This extension enhances the Radiant page part handling to...

  • render a page part depending on a URL parameter
  • render a request without layout on an AJAX request

This is especially useful when developing dynamic sites using unobtrusive JavaScript. Without JavaScript the page will be rendered normally with its layout, without JavaScript only single page part will be loaded without its layout.

The Radiant cache is extended to cache single page parts.

Part rendering

This extension also provides a tag content_requested, that renders only the part of the page that has been requested by the page request parameter. For example if you request a page through http://www.mywebsite.ch/?part=extended, only the part named extended will be rendered.

AJAX request

This extension provides a new page type AjaxPage, whereas the page won't render the associated layout when it is requested by an AJAX request. If no part request parameter is supplied, the first page part is returned. The distinction whether a HTTP request is a normal request or an AJAX request is done by evaluating the X-Requested-With HTTP header. Prototype automatically adds this HTTP header. To achieve the same behavior with JQuery, simple add the following snippet to your JavaScript file:

$(function() {
	$.ajaxSetup({
		headers: { "X-Requested-With" : "XMLHttpRequest" }
	});
});

Multi Site

This extension works together with the multi site extension. Important is that this extension is loaded after the multi site extension.

Contributors

Sponsors

Some work has been kindly sponsored by:

License

This extension is released under the MIT license, see the LICENSE for more information.

Releases

No releases published

Packages

No packages published

Languages