2

I have a view that's generating a block showing upcoming events. On the main site those events might be coming from multiple domains (the site is using Domain Access) and I'd like to show the domain owner as a link to their site sub-domain.

Example:

Aug. 14 - Sample Event
Domain Owner (http://owner.mydomain.com)

Is there a way that I can add this directly to the view? If not, what is the most effective/correct method for coding that into a view template override?

2 Answers 2

1

I believe that's relatively straight forward to achieve directly in your view without having to touch templates.

All you need to do is in your view, add a relationship of "Domain Source: Domain Node". This will then provide domain information against your nodes. Then in your fields you will be able to add relevant domain information against the node (using the relationship). So in your case I believe you would want to add the field "Domains: Site Name" and select the relationship in the dropdown. You should then have your site name displayed against your events which would link to the domain.

hope thats helps. Cheers

1
  • Thanks mrdrupal. I thought I had the Domain Views modules installe, but I didn't..that's why I couldn't add the relationship ;) Commented Aug 15, 2013 at 13:39
0

I know this is an older post but this might be helpful to someone down the line. In the latest version of Drupal, Views and Domain Access as of this posting. No relationship was required in views.

  1. ****Add the field: Domain Source: Domain Source ID**** (A little deceiving because it does allow the display of the domain name)
  2. Configuring the field there is a "Display As" Dropdown that lets you select either [Domain ID, Site Name, or Sub Domain].

NOTE: Other Domain Access data is also available without a relationship.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.