StreamPage 1.2.0-pl

StreamPage 1.2.0-pl

Released Jun 26, 2018 by intersel

StreamPage is way of generating ModX resource from its child's resources like getResources would do but using the template and its TV instead of a chunk.

It makes easy to generate "One Page" website.

Working like a getResources, it concatanates all the child's resources that are parsed with their respective templates and TV.

Usage

In the content or a template of the "root" page, simply add:

[[!$streamSections]]

Configure the templates of the children like you would do with chunks and the TV of the child with tv.<tv_name>

Download 56kb (90 downloads)
Downloads: 90
License: GPLv2
Requires Revolution 2.6.x or greater
Supports mysql

Usage

In the content or a template of the "root" page, simply add:

[[!$streamSections]]

Your templates used in the "stream" may call your TV the same way they are in getResources, eg tv.<template_var_name>.

Sample templates

You can have a look on the StreamPage_Root_Sample and StreamPage_Section templates.

StreamPage_Root_Sample may be applied on your root page, then the children of this page may use StreamPage_Section.

Hereafter a tree example of your resources

  • myHomePage (uses StreamPage_Root_Sample)
  • -> myFirstSection (uses StreamPage_Section)
  • -> mySecondSection (uses StreamPage_Section)
  • -> myThirdSection (may use any template whose content is like a chunk but with the use of template variables that can be configured for each child resource)

Properties

  • id
  • optional
  • default: current resource
  • The parent id to "stream".

  • streamTpl
  • optional
  • default: onePageChunk
  • a chunk name to apply on the children if default behaviour is not ok

  • limit
  • optional
  • default: no limit
  • similar to the getResources snippet property
  • Limits the number of resources returned. 

  • sortby
  • optional
  • default: menuindex
  • similar to the getResources snippet property
  • any Resource Field excluding Template Variables.

  • sortdir
  • optional
  •  default: asc
  • similar to the getResources snippet property
  • Order which to sort by
  • asc or desc

  • depth
  • optional
  • default: 1
  • similar to the getResources snippet property
  • Integer value indicating depth to search for resources from each parent. 

  • showHidden
  • optional
  • default: 1
  • similar to the getResources snippet property
  • If true, will show Resources regardless if they are hidden from the menus.

Placeholders

  • subpage
  • Always set to 1, tells to your template that it is used as a "stream" template.

Installation Instructions

  • Install via package manager.
  • Create a root page resource set with StreamPage_Root_Sample template
  • Create two resource children under the root page resource set with the StreamPage_Section template