After reading Eaton's well-written article http://www.lullabot.com/articles/great-pretender-making-your-data-act-field, I tried this in a module I work on. The fields are definitely showing on "Manage fields" in CCK. However, those added fields do not seem to be available to Views. One of the reasons why I am really interested in making this change is so that something like Node Export can see these fields automatically. What more needs to be done to the suggested code to have CCK reflect these fields to other modules? Nancy E. Wichmann, PMP Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
On Wed, Sep 16, 2009 at 10:03 AM, Nancy Wichmann <nan_wich@bellsouth.net> wrote:
After reading Eaton's well-written article http://www.lullabot.com/articles/great-pretender-making-your-data-act-field, I tried this in a module I work on. The fields are definitely showing on "Manage fields" in CCK.
However, those added fields do not seem to be available to Views. One of the reasons why I am really interested in making this change is so that something like Node Export can see these fields automatically. What more needs to be done to the suggested code to have CCK reflect these fields to other modules?
All that hook_content_extra_fields() really does is tell CCK about other node data so that they can be reweighted using the UI. Views support is a whole different animal that's done through hook_views_data()... and thorough documentation would make a great book. andrew
andrew morton wrote:
On Wed, Sep 16, 2009 at 10:03 AM, Nancy Wichmann <nan_wich@bellsouth.net> wrote:
After reading Eaton's well-written article http://www.lullabot.com/articles/great-pretender-making-your-data-act-field, I tried this in a module I work on. The fields are definitely showing on "Manage fields" in CCK.
However, those added fields do not seem to be available to Views. One of the reasons why I am really interested in making this change is so that something like Node Export can see these fields automatically. What more needs to be done to the suggested code to have CCK reflect these fields to other modules?
All that hook_content_extra_fields() really does is tell CCK about other node data so that they can be reweighted using the UI. Views support is a whole different animal that's done through hook_views_data()... and thorough documentation would make a great book.
andrew
You can find some documentation on Views2, including hook_views_data(), here: http://views-help.doc.logrus.com/help/views/api <http://views-help.doc.logrus.com/help/views/api-tables> Seth
andrew morton wrote:
All that hook_content_extra_fields() really does is tell CCK about other node data so that they can be reweighted using the UI. Views support is a whole different animal that's done through hook_views_data()... and thorough documentation would make a great book.
I already implement hook_views_data as best as I can decipher the existing docs (yes, a friendlier book would be great). It turns out that this does indeed make the data available at least to the Node Export module, which is goodness. My final goal is an complete import/export function for my node module. (Yes, I am looking at Import Export API too.)
Just a note: Table Wizard will export hook_views_data() for you now, which is a huge win. On Wed, Sep 16, 2009 at 1:06 PM, Nancy Wichmann <nan_wich@bellsouth.net> wrote:
andrew morton wrote:
All that hook_content_extra_fields() really does is tell CCK about other node data so that they can be reweighted using the UI. Views support is a whole different animal that's done through hook_views_data()... and thorough documentation would make a great book.
I already implement hook_views_data as best as I can decipher the existing docs (yes, a friendlier book would be great).
It turns out that this does indeed make the data available at least to the Node Export module, which is goodness. My final goal is an complete import/export function for my node module. (Yes, I am looking at Import Export API too.)
-- Ken Rickard agentrickard@gmail.com http://ken.therickards.com
Hi Nancy, The table wizard module might be able to help you describe your database tables to views, if that's where your data is stored. Table Wizard: http://drupal.org/project/tw Regards Steven Jones ComputerMinds ltd - Perfect Drupal Websites Phone : 024 7666 7277 Mobile : 07951 270 026 Twitter : darthsteven http://www.computerminds.co.uk 2009/9/16 Nancy Wichmann <nan_wich@bellsouth.net>:
After reading Eaton's well-written article http://www.lullabot.com/articles/great-pretender-making-your-data-act-field, I tried this in a module I work on. The fields are definitely showing on "Manage fields" in CCK.
However, those added fields do not seem to be available to Views. One of the reasons why I am really interested in making this change is so that something like Node Export can see these fields automatically. What more needs to be done to the suggested code to have CCK reflect these fields to other modules?
Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
participants (5)
-
andrew morton -
Ken Rickard -
Nancy Wichmann -
Seth Freach -
Steven Jones