Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#23 | domain_views-1301754-22.patch | 11.58 KB | artematem |
#21 | domain_views-1301754-21.patch | 11.67 KB | MrHaroldA |
#19 | interdiff.txt | 5.64 KB | drclaw |
#17 | domain_views_handler_field_domain_id_node_multiple.zip | 1.66 KB | 2pha |
#17 | domains_multiple_display.jpg | 22.98 KB | 2pha |
Comments
Comment #1
agentrickardNot a bug.
Comment #2
artatac CreditAttribution: artatac commentedPerhaps 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
Comment #3
agentrickardI 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.
Comment #4
artatac CreditAttribution: artatac commentedExcellent, thanks, the schools are really pleased with what can be achieved with domains, rather than two separate sites
Comment #5
agentrickardIt'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.
Comment #6
agentrickardI suspect this change will require a new branch, since it may break existing views.
Comment #7
Les LimHere'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.
Comment #8
agentrickardThat does sidestep the issue raised in #6.
Comment #9
rudiedirkx CreditAttribution: rudiedirkx commentedI tried domain_access.gids (not domain_editor.domain_ids) and that works perfectly. This should definitely be in Domain Access.
Comment #10
rudiedirkx CreditAttribution: rudiedirkx commentedThe output is double encoded. There's a
check_plain()
inrender_item()
and acheck_plain()
inpre_render()
. That's two. I've removed the one inrender_item()
in my local copy, so the separator can contain HTML, but the actual values can't.Comment #11
Les LimUpdated patch for #10.
Comment #12
panche CreditAttribution: panche commentedWell #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!
Comment #13
codewatson CreditAttribution: codewatson commentedWorks for me as well
Comment #14
vaccinemedia CreditAttribution: vaccinemedia commentedI 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."
Comment #15
vaccinemedia CreditAttribution: vaccinemedia commentedJust noticed the patch put the includes in the wrong place. Once they're in the module includes folder it works.
Comment #16
2phaSeems to work for me, Though it does not show all sites if the node has 'send to all affiliates' selected.
Comment #17
2phaI 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.
Comment #18
BrightBoldUsing 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.
Comment #19
drclaw CreditAttribution: drclaw commentedPatch 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!
Comment #20
MrHaroldA CreditAttribution: MrHaroldA commentedWorks 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 ...Comment #21
MrHaroldA CreditAttribution: MrHaroldA commentedHere's a simple search/replace 'all_doamin_' to 'all_domain_' revision of the patch.
Leaving it at 'needs work' because of the coding style ...
Comment #22
a.milkovskyworks perfect, thanks
Comment #23
artematem CreditAttribution: artematem at FFW commentedSlightly updated patch to add "Machine Name" display option.
Comment #24
artematem CreditAttribution: artematem at FFW commented