- πΊπΈUnited States markdorison
GitHub recently rolled out support for this very thing. I'd love to see it on Drupal.org!
- Status changed to Needs review
almost 2 years ago 6:05pm 21 February 2023 - πΊπΈUnited States markdorison
This patch should add
rel=me
to any link rendered from thefield_social_links
field. - Status changed to Needs work
almost 2 years ago 7:40pm 21 February 2023 - πΊπΈUnited States drumm NY, US
Thanks for the start on this!
We do not add any new code to .module files of features. Having so many places for custom PHP code to live leads to unnecessary complexity. Please add this to
drupalorg.module
This looks like it would apply to all URL fields on the site. I think the way forward is to add the formatter to
drupalorg_field_formatter_info()
, and then we can configure it for the one field. It would also be okay to hard-code something forfield_social_links
if there is a convenient place to do that on output. - πΊπΈUnited States markdorison
We do not add any new code to .module files of features. Having so many places for custom PHP code to live leads to unnecessary complexity. Please add this to drupalorg.module
@drumm Thanks for the tip. I can make this change!
It would also be okay to hard-code something for field_social_links if there is a convenient place to do that on output.
I did include a conditional limiting the change to
field_social_links
. Is this what you had in mind or is it not sufficient?+ if ($field['field_name'] == 'field_social_links') { + foreach ($items as $delta => &$item) { + $item['options']['attributes']['rel'][] = 'me'; + } + }
- Status changed to Needs review
almost 2 years ago 10:38pm 21 February 2023 - πΊπΈUnited States markdorison
Moved logic to
drupalorg.module
per #9. - πΊπΈUnited States drumm NY, US
Ah, I missed the if statement, since this is overriding the field formatter for all URL fields.
I did move this to
drupalorg_user_view()
since this is custom code just for one field. - Status changed to Fixed
almost 2 years ago 10:36pm 1 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.