What does the modifyEntrySources hook do exactly, and when might one use it? Can someone help clarify this please?


"Source" is in the context of "where an element is pulling its data from".

The easiest example is with Assets, because they have easily defined Asset Sources settings portion of the control panel, but all elements (entries, tags, categories, users, etc.) have sources behind the scenes.

See the CategorySources plugin for an example of how it might be used (including a screenshot).

  • I guess my question is more specific in regards this question and whether modifying EntrySources would affect the status drop-down menu in the Entry List view in any way? Feb 8 '15 at 19:53
  • 1
    Hehe, this is exactly what I guessed (read hoped) 'modifyEntrySources' does when I read the release notes last week. 'modifyEntrySortableAttributes' is pretty much useless in most cases for me, without being able to define it per section (source?).
    – carlcs
    Feb 8 '15 at 20:53
  • @Douglas the hook makes this possible: github.com/pixelandtonic/CategorySources
    – carlcs
    Feb 9 '15 at 22:26
  • @carlcs Thank you. That's the same link that brad posted above. But I did install it this time to see what it does. Still confused though. I looked at the code and can see that it added the categories to my entry sources, but how does that help me? No change to the CP that I can tell. Does this give me some new capability on the template side? Feb 10 '15 at 1:03
  • Ouups.. I should start reading SE post completely again. Totally missed Brad's last sentence, @Douglas!
    – carlcs
    Feb 10 '15 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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