资源算法craftcms-prune

craftcms-prune

2020-02-04 | |  61 |   0 |   0

Twig Prune for Craft CMS

Add a Twig filter for CraftCMS templates to "prune" out fields of entries.

Installation

  1. Move the prune directory into your craft/plugins directory.

  2. Go to Settings > Plugins from your Craft control panel and enable the prune plugin

Usage

The primary reason for this is to control the fields being output to json_encode.

{{ craft.entries.section('news').find() | prune(['title', 'body']) | json_encode() | raw }}

The above template will get all entries from the "news" section, grab just the title and body fields from each, and then output it to JSON.


上一篇:prunnable-layers-pytorch

下一篇:K210_Yolo_framework

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...