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
Comment #1
dawehnerIf you want you can use the get raw id from url default argument if you need that.
Comment #2
mrweiner CreditAttribution: mrweiner commentedHadn'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.
Comment #3
xaqroxYou should be able to use the "PHP Code" option and do something like
return $_GET['field_venue_reference_review'];
.Comment #4
MustangGB CreditAttribution: MustangGB commentedClosing 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.