Timeline for How can I redirect user/*/edit to another page based on user content?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 3, 2014 at 0:53 | comment | added | Steve | You're right, there isn't, but I can user_load() and have it - but, that won't give me the reference to the profile node. My solution is to use an entity reference field on each (user and profile), which gives me just what I need. Thanks for all your brainstorming! | |
Jan 2, 2014 at 20:45 | comment | added | Jimajamma |
I doubt there is a user variable being sent in via preprocess() , but it is available in the second argument. Once again, broad strokes here, it would be 1 if you were looking at user/1/edit-profile or just plain old user/1 and can be found via arg(1) (no relation to user 1 and 1 here, arg(#) just returns the #th argument in the path).
|
|
Jan 2, 2014 at 19:22 | comment | added | Steve |
This looks great, but I'm not getting anything usable if I put it in themename _preprocess. Here's what I'm doing $uid = $variables['user']->uid; $nid = db_select('node', 'n') ->condition('n.type', 'fellow_profile') ->condition('n.uid', $uid) ->fields('n', array('nid')) ->execute()->fetchField(); $variables['profile_nid'][] = $nid;
|
|
Dec 27, 2013 at 20:47 | history | edited | Jimajamma | CC BY-SA 3.0 |
added 103 characters in body
|
Dec 27, 2013 at 20:33 | history | edited | Jimajamma | CC BY-SA 3.0 |
added 225 characters in body
|
Dec 27, 2013 at 20:27 | history | answered | Jimajamma | CC BY-SA 3.0 |