How can I use the grouped nid in a views template with two content types?
Here's one way to solve this. This is the easiest way to solve it through the interface, without the need for templating or coding.
It may not be the best option performance-wise because of combining data from two db tables through Views, but then again you'd probably need to build a very custom query to optimize, and caching might solve possible lags.
It can all be done through the Offers Views, without Relationships and Contextuals, but with the help of View Modes.
View Modes don't have anything to do with Views module, so this is something to keep in mind, I wish they were named Display Modes or something along those lines. You've probably already used two of them before: Full and Teaser.
View Modes are different ways you can display your entity Fields. Each mode controls which fields are shown, in which order, and with which display settings.
You need to create two additional View Modes for your Business CT (you can do that on the &quot;Manage display&quot; page of your CT or through Structure &gt; Display modes &gt; View modes, it will appear among the tabs). One mode will be for the top Business info (so you should include the fields you want to show there), and the other for what is shown bellow the Offers.
In your Offers Views add the Offers Fields how you want them displayed.
Then add two Business Entity Reference fields as well.
Rearrange the fields so you have one Business reference on top of the fields list, and the other on the bottom.
Configure the top one's Formatter to Rendered entity and choose the View mode you created earlier for it. Exclude it from display and save, then choose it as the 1st grouping field under Format Settings.
Configure the bottom Business reference to also format as Rendered entity but choose the second View mode you created for it.
You should now have it all groupped by Businesses and displaying correct info in correct places. Be mindful of the pagination you set because it can &quot;break&quot; one Business to display on two pages depending on the number of offers.