I have a node A with a IEF field.
The child entity B has a ER field, and the selection of entities is made through a ER view display.

In want to filter the ER view base on the "current" parent entity A, which is the node where the IEF form is hosted, but I cannot get to pass the nid to the contextual filter.
If I print the "current_path()" as field of the view, it appears to be "system/ajax", and not the actual node/nid, so my guess is that I need to get the nid info from somewhere elso, but where and how? Can someone help?

Comments

shablm’s picture

You could use $_SERVER['HTTP_REFERER']

Something like:
$url = drupal_parse_url ( $_SERVER['HTTP_REFERER'] );
$path = $url['path'];
if (strpos( $path, 'node' ) != 0) {
$alias = substr($path, strpos( $path, 'node' ));
$parent_node = menu_get_object('node', 1, $alias);
}

dcam’s picture

Status: Active » Closed (outdated)

I'm closing old IEF support issues. Please feel free to re-open the issue if you still require assistance.