Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm making my first steps authoring simple modules. I would like to make my life easier by implementing a custom field for taxonomy views, a field named: "Taxonomy term: Arbitrary ascendant" so that it gets a term's ascendant at the given hierarchy level, as returned by taxonomy_get_parents_all.

Similarly, for content Views, I would like to provide a field configuration that would allow for ascendant tests for any term on an entity.

Could anyone point me to the Views API functions that must be taken into account to make this module properly authored?

share|improve this question

Try views.api.php

Describe hooks provided by the Views module.

& Views hooks

Hooks that can be implemented by other modules in order to implement the Views API.

share|improve this answer
+1. But please consider adding some actual text, may be a teaser from the above docs file so your answer is "compact" – AyeshK Feb 15 '13 at 12:20

A way I have gone about this recently is to add a place holder field to a content type. I then create a module that provides a tpl.php for this field and use a preprocess function to actually calculate it.

share|improve this answer
Yes, that's one way, I am also able to do another - with a custom formatter, which I already got working. My goal however is to start doing more "native" things... Thanks though. – Artur Feb 1 '12 at 22:27
I agree. While I like having what I've done in a module so it is at least theme independent, I'm still trying to work out a way to have that available outside of views and to be more tightly integrated into the field. – Malks Feb 1 '12 at 23:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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