Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
2  
+1. But please consider adding some actual text, may be a teaser from the above docs file so your answer is "compact" –  Ayesh K Feb 15 '13 at 12:20
add comment

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
add comment

Your Answer

 
discard

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.