craftcms-prune icon indicating copy to clipboard operation
craftcms-prune copied to clipboard

Allow single element

Open russback opened this issue 10 years ago • 1 comments

It would be great if this allowed a single entry rather than an array of entries.

russback avatar Feb 19 '15 12:02 russback

Hey @russback ... Perhaps something like this ...

{{ craft.entries.section('news').first() | prune(['title', 'body'], {'single':true}) | json_encode() | raw }}

howardroark avatar Aug 28 '15 16:08 howardroark