I have content that I have published to:
domainA
domainB
But. Their does not seem to be a way within views to add a field that shows ALL domains a node is published to eg
Apple article title
Body text more text
Published to domainA, domainB
----------
Views seems to simply choose one of the domains and lists that
Regards

Joe

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Category: bug » feature

Not a bug.

artatac’s picture

Perhaps I should have put it as a feature request. sorted it like this anyway http://venturacottage.com/tutorials/theming/multi-coloured-calendar-base...

regards joe

agentrickard’s picture

I saw that post.

We should probably handle this case as well, but usually people just want the canonical domain. We would need to use views_field_handler_multiple as the base class instead.

artatac’s picture

Excellent, thanks, the schools are really pleased with what can be achieved with domains, rather than two separate sites

agentrickard’s picture

Title: List all domains published to » Support multiple value output for fields

It's interesting -- looking back -- I didn't write the original code, and there are several values here that could be multiple.

This is only true when joining nodes (or users) to the {domain_access} table.

Currently, fields for both {domain} -- which cannot be multiple -- and {domain_access} use the same field handlers. This is obviously wrong.

What we probably need to do is split the handlers correctly, so that {domain_access} has multiple value support. This is pretty low on my priority list though, so I'd love for someone else to take a swing at it.

The fields in question are:

* sitename
* domain_id
* subdomain

And possibly the filters that go with them.

agentrickard’s picture

I suspect this change will require a new branch, since it may break existing views.

Les Lim’s picture

Status: Active » Needs review
FileSize
9.54 KB

Here's a start. The attached patch implements two new field handlers each for {domain_access} and {domain_editor} extending views_handler_field_prerender_list, leaving the existing field handler intact so as not to break things.

I'm not an expert in crafting Views handlers, so a review by someone would be appreciated. But this is working.

agentrickard’s picture

That does sidestep the issue raised in #6.

rudiedirkx’s picture

I tried domain_access.gids (not domain_editor.domain_ids) and that works perfectly. This should definitely be in Domain Access.

rudiedirkx’s picture

Status: Needs review » Needs work

The output is double encoded. There's a check_plain() in render_item() and a check_plain() in pre_render(). That's two. I've removed the one in render_item() in my local copy, so the separator can contain HTML, but the actual values can't.

Les Lim’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
9.52 KB

Updated patch for #10.

panche’s picture

Well #11 says broken handler when you add the Domains field, so I don't think is ready.
I will take a look into it to see what we can do. Sorry the include files were not created in the includes folder, because of that, it was broken.
It works like a charm!

codewatson’s picture

Works for me as well

vaccinemedia’s picture

I appear to be getting "Broken/missing handler". I have a views bulk operation table and the last column I am clicking on "Add" for fields, selecting "Domain Access" from the drop down and then selecting the "Domain Access: Domains" field, it this correct? The description of the field is "All domains of the record displayed in a single row."

vaccinemedia’s picture

Just noticed the patch put the includes in the wrong place. Once they're in the module includes folder it works.

2pha’s picture

Seems to work for me, Though it does not show all sites if the node has 'send to all affiliates' selected.

2pha’s picture

I took a look and changed the multiple handler supplied by the above patch.
Sorry, no time for a patch.
I added the ability so when a node is on 'all affiliates' it can display all the domains, or some text.
I will upload an image so you can see what I added and also the file.
Maybe someone can go over this and supply a patch.

BrightBold’s picture

Using the patch in #11, plus moving the .inc files to the includes folder, plus replacing the multiple node handler with the one in #17 and this works perfectly and is a great feature.

For people who are too lazy to RTFM, please note that the patch adds a new Views field option — Domain Access: Domains for nodes and Domain Editor: Domains for users — to avoid breaking existing views per #6. So don't keep clearing your cache trying to get multiple value options to appear on your the existing fields. Not that I did that or anything.

drclaw’s picture

Patch in #11 and replacement .inc file from #17 is working for me as well. Here's a patch and interdiff between #11 and #17.

Thanks everyone!

MrHaroldA’s picture

Status: Needs review » Needs work

Works nice, except for the typo in 'all_doamin_text' and 'all_doamin_show' ...

EDIT: and those options are missing in the 'domain_editor' fields too. This is because users don't have a 'Send to all domains' option ...

MrHaroldA’s picture

FileSize
11.67 KB

Here's a simple search/replace 'all_doamin_' to 'all_domain_' revision of the patch.

Leaving it at 'needs work' because of the coding style ...

a.milkovsky’s picture

Status: Needs work » Reviewed & tested by the community

works perfect, thanks

artematem’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
11.58 KB

Slightly updated patch to add "Machine Name" display option.

artematem’s picture

Status: Needs review » Reviewed & tested by the community