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 created a new content type witch has a image and a link to a site (external link).
I have created a block in views added the link field and image field. The link is OK the image I have tried to rewrite output and link the image to the external site.
If I enable external server URL the link is broken (http://%7B%7B%20field_link_site_sponsor%20%7D%7D/), if I disable external server it link's internally (http://system.com.ro/http%3A//www.bo-studio.ro; system is test domain bo-studio is the domain I want to link to).
I link using replacement pattern ({{ field_link_site_sponsor }})
Comments
Comment #2
bkudrle CreditAttribution: bkudrle commentedI am having a similar issue. In my Drupal 7 site, to have an external URL in views, I was able to do the following under Rewrite Results for a given field:
* Select 'Output this field as a link'
* Use the [Replace Pattern] value in the Link Path field
* Click the 'External server URL' checkbox
* In my case, I also filled the Target field with '_blank'
Note that the Replacement Pattern in my Drupal 7 application did not use the http:// or https:// in the value (i.e., only strings like 'www.google.com'). That worked fine for opening other websites when the user clicked on the link.
For version 8.0.0, now I seem to have to do the following to get this to work in a similar way.
* Select 'Output this field as a link'
* For the Link Path field, I now need to put 'http://{{Replacement Pattern}}
* In this case, I also filled the Target field with '_blank'
Note that if I select the 'External server URL', the Replacement Pattern is not replaced, as yang_system noted in the original post. I suppose this is workable, but I am wondering why the 'External server URL' checkbox is even there anymore, especially since it seems to over-ride the Replace Patterns.
Comment #3
Lendudemoving to the right queue and closing as duplicate for #2488540: Rewrite external links in views fields