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.
It would be incredibly useful to have an entity token available for the display_url. [node:field-link:url]
strips the query string from the URL, which makes it difficult to use it as a replacement in Linked Field, Views and elsewhere.
I can't make a patch, but the following changes seem to do the trick:
Adding 'display_url' to the array at line 1088 in function link_field_item_create():
return array('title' => NULL, 'url' => NULL, 'display_url' => NULL);
Adding the $properties['display_url']
array at line 1105 in function link_field_item_property_info():
$properties['display_url'] = array(
'type' => 'uri',
'label' => t('The full URL of the link.'),
'setter callback' => 'entity_property_verbatim_set',
);
Comment | File | Size | Author |
---|---|---|---|
#1 | 1909788-display_url.patch | 814 bytes | mthomas |
Comments
Comment #1
mthomas CreditAttribution: mthomas commentedPatch attached.
Comment #2
csc4 CreditAttribution: csc4 commentedThis sounds brilliant - will it also be available in custom content panes context keywords?
Comment #3
Kpolymorphic CreditAttribution: Kpolymorphic commentedWorks well thanks! I tested this in a project with the same need, and it did exactly what I needed.
Comment #4
renatogWorks good for me too.
+RTBC.
Regards.
Comment #6
renatogFixed.
Commited in dev branch.
Regards.