mattstauffer / craftcms-prune

CraftCMS Prune Twig plugin
49 stars 2 forks source link

Added support for entry types & other element types #1

Closed jlawrence-yellostudio closed 9 years ago

jlawrence-yellostudio commented 10 years ago

This adds support for entry types, which are blank if you include the 'type' within the prune list. Unfortunately it does not yet allow for pruning of nested data; this could be achieved using a dot notation.

E.g. type.handle, type.name

Also by changing the EntryModel instance of restriction to BaseModel we can prune assets too.

mattstauffer commented 9 years ago

UGH. You were all doing this work in October and I just saw that my Github notification settings were set so I never even got a single notice about this.

I'm so sorry. @timkelty, @jlawrence-yellostudio, is this still good to go? I'll gladly just merge it in.. :/

timkelty commented 9 years ago

good 'ole Matt "set it and forget it" Stauffer. :) But really, no sweat. I've used the PR version in production, so I think it should be ready to go.

As for the other discussion nested fieldtypes:

It would be a nice feature, yes...however: Since that original discussion, I've taken to always having a "custom" plugin on any build for this kind of thing.

Especially if you have that already set up, it's SO easy to either just write a quick custom Twig filter or use a template hook to handle more custom pre-template data handling.

For me, that's actually an easier solution than trying to remember the options and syntax for using another filter/plugin.

mattstauffer commented 9 years ago

👍 that's a fun nickname. :) thanks a ton. And I'll merge this In now.