I think I am trying to do something fairly basic, but it is proving enormously difficult to find the documentation, or examples to accomplish it.
On submission, I simply want to send the nid of my CCK form to my url and send that on to another page. I have been trolling, working through the API, trying php snippets, reading, experimenting, buying Lullabot videos, going through tutorials, trying, installing, uninstalling, reinstalling - to the point I'm ready to go find a nice, quiet job at McDonalds.
My users have a uid, the node they have just submitted should have an nid - I hope to end up using those values to
display a view. And I know that they can be somehow passed into the View - but I have to get them from the original page first. It seems
that in Views things just sort of "magically" appear in the Preview section in the videos and tutorials... they don't get into the
tricky bits...No one ever talks about how you get that Preview to work in "real life" with a real URL coming from someplace unknown to the View.
To clarify:
- My users fill out a CCK form and hit Submit.
- From there they go to a View, where they can make a further selection.
- If they ever, please God, get that far - they will end up on a third page where they will make a final selection. After that,
- An email will be sent off to the proper authorities and I will collapse in a mixture of bitterness and desire for revenge on whomever talked me into this...
Nid into the URL. Sent to the next page where it can influence what is shown.
If anyone could help me, I would be beyond grateful.
If anyone needs further clarification - I will be happy to give it - right after I finish spraying the house with aerosol Valium. :-S
Thanks in advance.
Comments
a view using args & an action (or rule) sending 'em there
Hi cbear42,
Your view can use the UID and NID as args to build the page display path. Like, user/%/% (user/UID/NID).
Help using views arguments is here:
http://views-help.doc.logrus.com/help/views/argument
You can send users to that path (with the correct NUD & UID) using drupal_goto() in an action that gets triggered on node INSERT or UPDATE.
Help writing actions is here:
http://drupal.org/node/172152
An action of type 'user' (using hook nodeapi 'insert') will give you both the NID of the created node, and the UID of the author, if you know where to look...
The node object (where you can get $node->nid) comes from $context. Like
<?php$node = $context['node'];
?>
And the user object comes from $object like
<?php$uid = $object->uid;
?>
Or you can use the Rules module and skip writing your own action
http://drupal.org/project/rules
Hope that helps
rules modules and tokens will
rules modules and tokens will solve ur problem, i have the same problem...
Thanks!
I had read most of these things - just needed sleep and a voila moment to have it all make some sense. Thanks to everyone who responded!