From d909dcee4f10ed00e5d64514ff66ac43266b5bc2 Mon Sep 17 00:00:00 2001 From: Benjamin Fleming Date: Wed, 11 May 2016 15:06:06 +1000 Subject: [PATCH] Released v1.0.2 --- CHANGELOG.md | 3 +++ README.md | 33 ++++++++++++++++++++++++++++++++- neo/NeoPlugin.php | 2 +- package.json | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f834da2e..c7eeb1f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +#### v1.0.2 +- `Added` Added ability to get child blocks in the template. This implementation will be deprecated soon in a later release but will remain supported throughout all 1.x versions. + #### v1.0.1 - `Added` Added ability to query against block level in templates, like with categories and structure sections diff --git a/README.md b/README.md index c8295cc1..be9d90d2 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,35 @@ Neo is a [Craft CMS](https://craftcms.com) field type that builds upon the conce ## Release -Version `1.0` is out baby! [Grab your copy today](https://github.com/benjamminf/craft-neo/archive/1.0.1.zip). Will update this README in the coming days with a complete presentation of the plugin. +Version `1.0` is out baby! [Grab your copy today](https://github.com/benjamminf/craft-neo/archive/1.0.2.zip). Will update this README in the coming days with a complete presentation of the plugin. + +## Template usage + +```twig +
    + {% for block in entry.neoField.level(1) %} +
  1. {{ block.type }} + {% if craft.neo.hasChildren(block) %} +
      + {% for childBlock in craft.neo.children(block) %} +
    1. {{ childBlock.type }}
    2. + {% endfor %} +
    + {% endif %} +
  2. + {% endfor %} +
+``` + +Or use the `{% nav %}` tag to recursively generate a Neo field structure: +```twig +
    + {% nav block in entry.neoField %} +
  1. {{ block.type }} + {% ifchildren %} +
      {% children %}
    + {% endifchildren %} +
  2. + {% endnav %} +
+``` diff --git a/neo/NeoPlugin.php b/neo/NeoPlugin.php index 4b888b06..4380f882 100644 --- a/neo/NeoPlugin.php +++ b/neo/NeoPlugin.php @@ -22,7 +22,7 @@ public function getDescription() public function getVersion() { - return '1.0.1'; + return '1.0.2'; } public function getCraftMinimumVersion() diff --git a/package.json b/package.json index e4d0ba35..6347ef1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "craft-neo", - "version": "1.0.1", + "version": "1.0.2", "description": "A Matrix-like field type that uses existing fields", "main": "webpack.config.js", "scripts": {