Question

I'm using Organic Groups and I'm giving users a link to create content for the current group. I do this by giving the path node/add/grouptype?gids_node[]=1891.

This works fine, as the group is set by default. However, I can't get this to work on the overlay: node/1962#overlay=node/add/grouptype?gids_node[]=1961 makes the overlay not appear at all and node/1961?gids_node[]=1961#overlay=node/add/grouptype shows the overlay, but I don't think the argument is passed correctly.

Do you have any idea? I can't find any documentation on this.

Was it helpful?

Solution

Okay, turns out it had nothing to do with overlay and had to do with correctly using l() function. If you want to add a query/arguments to a link using l function, you need to give a query argument to it. For example:

print l("Add page", "node/add/grouptype", array('query' => array('gids_node[]' => $group->etid)));

Otherwise, the ? will be encoded to %3F

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top