/PyroStreams-Page-Field-Type

Pages field type for use with PyroStreams

Primary LanguagePHPBSD 2-Clause "Simplified" LicenseBSD-2-Clause

PyroStreams Page Field Type 2.0.1

This field type allows you to select a page from your PyroCMS page tree as a PyroStreams field.

Changelog

2.0.1 - April 19, 2013

  • Adding proper data check to pre_output_plugin

2.0 - April 18, 2013

  • Now compatible with PyroCMS 2.2.x
  • Adding more available variables, including the anchor variable (see below)

1.2 - January 17, 2011

  • [New] Added current variable that returns true/false whether the current page is the selected page.

1.1.1 - December 15, 2011

  • [Bug] Fixed bug where when editing an entry with a page field, the page field would not show the selected page as selected

1.1 - December 13, 2011

  • [Updated] Updated to be compatible with PyroCMS 2.0 and PyroStreams 2.1
  • [New] Added drop down that displays page hierarchy.
  • [New] Added a link to the PyroCMS page edit page when displaying page name on the back end.
  • [Improvement] Field now obeys is_required setting for assignment.

Installation

If it doesn't exist exists, create a field_types folder in either _addons/ or addons/shared_addons. Create a folder called "page" in your field_types folder and add the file in this repo to that folder.

Usage

After being assigned to a stream, the following variables are available in your layouts:

Variable Notes
{{ field_slug:link }} Full URL to the page
{{ field_slug:anchor }} Anchor with full URL and title used as the anchor text.
{{ field_slug:slug }} Page URI slug
{{ field_slug:title }} Page title
{{ field_slug:id }} Page ID
{{ field_slug:status }} Page status (draft or live)
{{ field_slug:current }} Whether or not this is the current page. Returns true/false
{{ field_slug:parent_id }} ID of the parent page
{{ field_slug:entry_id }} ID of the stream entry that this page is linked to.
{{ field_slug:type_id }} ID of the page type this page is linked to.
{{ field_slug:meta_title }} Unparsed metatitle.
{{ field_slug:meta_title }} Unparsed metatitle.
{{ field_slug:meta_description }} Unparsed meta description.
{{ field_slug:comments_enabled }} Are comments enabled? 1 or 0.
{{ field_slug:status }} 'live' or 'draf'.
{{ field_slug:strict_uri }} Is this page set with a strict URI? 1 or 0.
{{ field_slug:is_home }} Is this page the home page? 1 or 0.
{{ field_slug:css }} The page CSS.
{{ field_slug:js }} The page JS.