Hi.

Thanks for the module. Works great!

I was wondering if it might be helpful to have the link added as a field instead of adding it to a text body. That way it can be singled out in Views, the link doesn't show up in the text body, and it won't be affected when the text body is trimmed.

Any thoughts?

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

manuel.adan’s picture

Would be nice. Any updates?

psychobyte’s picture

haven't played with this module in a long time. would love to see if this was even considered.

brooke_heaton’s picture

Title: Add link as field » Add tags markup as field
Status: Active » Needs work
brooke_heaton’s picture

Added patch to set $tags as a pseudofield using hook_field_extra_fields() and hook_entity_view. The OpenGraph markup may now be shown or hidden below trimmed text fields and is no longer appended to the end of $text.

brooke_heaton’s picture

Status: Needs work » Needs review
FileSize
5.17 KB

Updated patch to pass $filter argument through processor and to clear cache on hook_entitity_update

SocialNicheGuru’s picture

brooke_heaton, can you a screen shot of what the author or user might see?

brooke_heaton’s picture

Updating patch to resolve missing brackets on else statement and to revise cache call.

brooke_heaton’s picture

FileSize
26.89 KB
59.58 KB

As a new pseudo-field, the opengraph markup can now be added to entities as a new field. In this case, I have added it to a text field called 'Story Text', which is trimmed. Now I can show the opengraph markup from a shared link below the trimmed field just like on Facebook. This field is completely themeable.

DS settings for new field
Opengraph Pseudo-field in DS

Rendered html from opengraph tag markup as field under text field Teaser
Opengraph markup displayed on Teaser

SocialNicheGuru’s picture

not all entities supply a type so the line $entity->type in the patch causes multiple errors:
bootstrap_tour_step caused this one:
Undefined property: Entity::$type opengraph_filter.module:563 [23.98 sec, 206.73 MB] [notice]
Undefined property: MessageType::$type opengraph_filter.module:563 [24.13 sec, [notice]
207.21 MB]
Undefined property: OgMembershipType::$type opengraph_filter.module:563 [30.8 sec, [notice]
207.23 MB]
207.6 MB]
Undefined property: SearchApiIndex::$type opengraph_filter.module:563 [30.93 sec, [notice]
207.6 MB]
Undefined property: RulesReactionRule::$type opengraph_filter.module:563 [31.18 sec, [notice]
209.09 MB]

3dnathaniel’s picture

I am extremely interested in this patch. Can we get the issues mentioned by socialnicheguru resolved?

3dnathaniel’s picture

I have applied the patch at #8 but how do I get this to work? I am not using displaysuite. Is this psuedofield available to views? Panels?

SocialNicheGuru’s picture

Status: Needs review » Needs work
Related issues: +#2827181: Lots of notices during cron

Causes a number of notices during cron: https://www.drupal.org/node/2827181

I run drush cron --debug

It seems that 'type' is not defined for a number of entity types.

brooke_heaton’s picture

Added fixes to resolve problems and to have the extra_fields properly work with multiple text input fields.

ph7’s picture

Great module indeed!

Instead of, or in addition to a link field, maybe consider a link formatter. That would perhaps allow for greater flexibility and adaptability.

loon’s picture

Assigned: Unassigned » loon
Status: Needs work » Needs review