3

So, i must write this Craft plugin to index documents as soon as they are published, though a special publication field used amongst different pages templates (including a matrix field !).

How can i use the publish event to detect that this special kind of assets (assets belonging to a special directory) have been used ?

2 Answers 2

2

You could use the entries.onSaveEntry event to get entries as they're saved, check the publish date, then loop through its properties, and check the paths on any assets.

You'd probably also want to hook into entries.onDeleteEntry to de-index any assets from entries that get deleted.

Please note: this won't auto-index entries that were scheduled to publish at a later date.

1
0

The Craft Introvert might be what you're looking for...

enter image description here

1
  • Actually, disregard that. A post-caffeine re-read says I misread your question, sorry.
    – Rick
    Commented Jul 19, 2015 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.