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.
Add support for the ProgramMembership schema on the D8 release.
Comment | File | Size | Author |
---|---|---|---|
#31 | program-membership-2937212.patch | 25.54 KB | KarenS |
| |||
#29 | program-membership-2937212.patch | 49.6 KB | KarenS |
| |||
#28 | program-membership-2937212.patch | 41.53 KB | KarenS |
| |||
#26 | program-membership-2937212.patch | 41.53 KB | KarenS |
#24 | program-membership-2937212.patch | 41.53 KB | KarenS |
Comments
Comment #2
DamienMcKennaComment #3
DamienMcKennaComment #4
thejimbirch CreditAttribution: thejimbirch commentedWorking on this.
Comment #5
thejimbirch CreditAttribution: thejimbirch commentedAttached is a patch that adds the schema_program_membership module.
The module provides the following fields:
name
programName
alternateName
hostingOrganization
member
membershipNumber
identifier
additionalType
description
disambiguatingDescription
image
mainEntityOfPage
url
sameAs
The only thing missing would be the potentialAction field which would indicate a potential Schema Action. Since there are a few actions that can be added to this and other Schemas, I created another ticket for Add support for Actions.
Please review the tests file. I am not familiar with that all, and while I believe I set it up right, I do not know how to test it.
Comment #7
thejimbirch CreditAttribution: thejimbirch commentedUpdated patch attached hopefully fixing failed tests.
Comment #9
thejimbirch CreditAttribution: thejimbirch commentedI am not sure why the tests are failing. Could someone take a look and advise?
Comment #10
KarenS CreditAttribution: KarenS at Lullabot commentedIt's failing on "additional@type". Try removing the "@" sign from that.
Comment #11
thejimbirch CreditAttribution: thejimbirch commentedI guess that is why I am stuck. There is no "additional@type" in the patch. Could the tests be adding the @?
Comment #12
KarenS CreditAttribution: KarenS at Lullabot commentedAh yes, the problem is in the test. I just committed a fix to the test. Let's see if that works.
Comment #13
KarenS CreditAttribution: KarenS at Lullabot commentedWah wah, now I broke the branch tests. Working on it...
Comment #14
KarenS CreditAttribution: KarenS at Lullabot commentedOK tests are working again and now this patch passes.
Comment #15
thejimbirch CreditAttribution: thejimbirch commentedThanks so much @KarenS!
@DamienMcKenna This should be good to go as is. The only thing it is missing from the Schema.org spic is potentialAction which indicates a potential Schema.org Action. I think that could be added later, after #2942047 - Add support for Actions is added.
Comment #16
ChristophWeber CreditAttribution: ChristophWeber at BIZX LLC commentedI agree on Actions. The base stuff needs to go in first, then we can extend ProgramMembership.
From an SEO perspective potentialAction @type SearchAction is probably the most useful type, as Google can show a site search box. https://developers.google.com/search/docs/data-types/sitelinks-searchbox
Comment #18
KarenS CreditAttribution: KarenS at Lullabot commentedCommitted. Thanks!
Comment #19
KarenS CreditAttribution: KarenS at Lullabot commentedI pulled this in but am thinking about it more. How do you intend to use this? If a ProgramMembership would be the primary object on some page, it should be a module as in this patch. If the use would be to show a ProgramMembership as a property on another object, like a person or organization, ProgramMembership should be a base class and we should add the program membership property to the appropriate objects.
Comment #20
KarenS CreditAttribution: KarenS at Lullabot commentedComment #21
KarenS CreditAttribution: KarenS at Lullabot commentedBasically the question is would this be a top level object (i.e. a node), or only a property on another object? If the second, I need to pull this out and rework it before the next release.
Comment #22
ChristophWeber CreditAttribution: ChristophWeber at BIZX LLC commentedLooking at http://schema.org/ProgramMembership this is a property of Organization or Person, i.e. needs to be a base class and added to the other two. Definitely not its own object.
Comment #23
thejimbirch CreditAttribution: thejimbirch commentedI am not DamienMcKenna, but to build this as a property makes more sense vs the way I built it in the patch above in #7.
Comment #24
KarenS CreditAttribution: KarenS at Lullabot commentedHere's a patch to remove the module and replace it with a base class, then use the base class for a memberOf property on Person and Organization.
Comment #26
KarenS CreditAttribution: KarenS at Lullabot commentedComment #28
KarenS CreditAttribution: KarenS at Lullabot commentedComment #29
KarenS CreditAttribution: KarenS at Lullabot commentedClean up visibility settings.
Comment #30
KarenS CreditAttribution: KarenS at Lullabot commentedActually I probably shouldn't just delete the module. If someone has enabled it and it disappears they'll have problems. So I can mark it deprecated and add a hook to uninstall it. I'll leave it there for the next release. Then in the following I'll remove it. Ditto for the VotingAPI module.
Comment #31
KarenS CreditAttribution: KarenS at Lullabot commentedAgain, with an update hook.
Comment #32
thejimbirch CreditAttribution: thejimbirch commentedPatch applies.
Update hooks run without error.
ProgramMembership appears as an option of memberOf in Organization
Looks good to me.
Comment #34
KarenS CreditAttribution: KarenS at Lullabot commentedIf someone comes back later with a good use case for top-level ProgramMembership we can revisit, but I doubt that will happen.