Guys, I have facing issues about using php custom field in views based on http://drupal.org/project/views_customfield, What i want to ask about is :

1. How I add node using views custom field and passing an arguments to the new nodes.
2. When I clicking some-link and then it called a view and passing the arguments.

for information,

I have two content type :

1. Travel (cck node referer to Expense)
2. Expense (cck node Reference to Travel)

and creating two kind of views

1. Travel report
2. detail expense

I want to displaying :

This field into table style :

Title : node title
description : node body
expense detail : link (when i clicking to it, it will called views detail expense)
action : add new expense (this is also a link that will calling add node expense and passing the node Id to node reference to the new expense)

I have really desperate looking any solution for my problem, so i willing to know if you guys can help me, also i'm new in Drupal.

please forgive me (my English is not good too) :(

Thanks before. I really appreciate your help.

Comments

john_b’s picture

I asked a similar question in coding forum
http://drupal.org/node/1319804
No reply yet, but you might keep an eye on that thread in case I or someone comes up with the answer. Maybe someone in the customfield issue thread will help.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

wiliam_steven’s picture

Wow... John, We have facing same issue here, anyway do you have any thought or lead ?

john_b’s picture

I got it working for a single item in Views, it was hugely complicated, following this
http://drupal.org/node/1132368

Please don't ask me how to do it in more detail!

One could create such a view for each item and put them all on a page.

There is a (resource heavy) module for displaying a view within a view, maybe if I had enable Relationship I would have been able to get them to work well together, but it was just showing my new field repeatedly as it was under each item in the parent view. The level of complexity is stupid.

For D6 there is Views Group By module which claims to do this. Maintainers have not yet answered a thread about porting for D7. There must be simple coding solution.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ayesh’s picture

Not sure if I'm answering your problem.
Do you want to auto-complete the node-reference field from the currently visible node ?

Then use http://drupal.org/project/nodereference_url (works only with Node Reference fields,elegant) or http://drupal.org/project/urlfill (works with many fields, extensive, not so elegant) module.
To get other fields in Views PHP without using ugly $object stuff, Add this patch: http://drupal.org/files/issues/views_customfield.patch

john_b’s picture

I will come and look at this in more detail when I have recovered from another late night trying to sort it out. I have not used node reference, maybe it will work, filtering for published and outputting a summary.

In simple terms my problem, related to OP's problem, is to make a view on a list of menu items or taxonomy terms, and output a field which counts the nodes which have those menu items or taxonomy terms attached.

E.g. create a bookshop catalogue with headings for books by Shakespeare and books by Dickens, output a page with nothing other than :

Page title: Catalogue Summary
Catalogue Section 1 (could be a taxonomy term, a menu link, or a Nodequeue item): Books by Shakespeare: Number of items in stock (xy)
Catalogue Section 2 : Books by Dickens: Number of items in stock (xy)
where each book is a published node of type:product.

In my case the catalogue headings are grouped by Nodequeues, each nodequeue has a view with a menu link (which is the catalogue heading). But they can also be given a taxonomy term, it that makes it easier to collect them.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors