I have a business review site, and I would like to display the business info at the top of the review form using a View Block.

When users decide to review a business they actually create a node of type review. This content type has an entity reference field that is pre-populated based on the URL to relate it back to the correct business. As a result, the URL does contain an NID, but just not for the current node since the page is actually a content creation page and not a node. Is there a way to use the Contextual Filter/Argument setting of "Content ID from URL" to grab this NID, and populate the View's fields based on it, even though it is not in a spot where the module expects it to be?

I tried to make this as clear as I could, but if any further clarification is needed, please don't hesitate to let me know. Thanks in advance for any help.

Comments

dawehner’s picture

If you want you can use the get raw id from url default argument if you need that.

mrweiner’s picture

Hadn't thought of doing that. However, when I do, it isnt' working for me. I'm assuming the format of the url is still a problem. It is formatted as "node/add/review?field_venue_reference_review=9", so the raw id isn't an isolated component of the url. The use is that the url is being used to populate an entity reference field through a module, so I don't think that I can change the path of the url.

xaqrox’s picture

Issue summary: View changes

You should be able to use the "PHP Code" option and do something like return $_GET['field_venue_reference_review'];.

MustangGB’s picture

Status: Active » Closed (outdated)

Closing this as outdated to tidy up a bit around here. If you're still having problems with the latest release please create a new issue.