在节点字段中嵌入外部图像链接,而不将它们下载到自己的站点?

发布于 2024-12-15 11:13:11 字数 181 浏览 3 评论 0原文

在 Drupal 7 中;

  • 我想通过将其链接提供为“http://www.example.com/aa.jpg”来在我的节点中显示外部图像
  • 我不希望它们下载到我的网站
  • 我将通过字段进行制作

是否有Drupal 7 的模块这样做吗?

谢谢。

In Drupal 7;

  • I want to show external images in my nodes by giving its link as "http://www.example.com/aa.jpg"
  • I don't want them to download to my site
  • I will make it by the fields

Is there a module for Drupal 7 doing this?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

土豪我们做朋友吧 2024-12-22 11:13:11

简而言之...是的!

您可以安装媒体模块以及远程流包装器模块

添加新图像字段时,选择“媒体文件选择器”小部件。这:

提供将外部文件与文件字段一起使用的功能,而无需将文件保存到本地文件目录。还提供“远程 URL”浏览器插件。

进一步查看 Remote Stream Wrapper 的模块页面,发现它是这样做的:

默认情况下,模块添加对使用 http://、https:// 或 feed:// 的任何 URL 的支持

我认为这正是您所追求的。

我还建议安装 Media Browser Plus 模块,它可以在用户选择图像时提供更好的浏览器。

In short...yes!

You can install the Media module along with Remote Stream Wrapper module.

When you add your new image field, choose the 'Media file selector' widget. This:

Provides the ability to use external files with file fields without saving the files to your local files directory. Also provides a 'Remote URL' browser plugin.

A further look at the module page for Remote Stream Wrapper says it does this:

By default the module adds support for any URL using http://, https://, or feed://

Which i think is exactly what you're after.

I'd also recommend installing the Media Browser Plus module which provides a better browser for when your users are picking images.

眉黛浅 2024-12-22 11:13:11

在 Drupal 7 中,您已经将 Imagecache 作为核心模块。您所要做的就是安装ImagecacheExternal。这是一个实用程序模块,允许您将图像缓存(D6)/图像衍生品(D7)与外部图像一起使用。
启用模块后,设置以下权限:

  • 查看外部图像
  • 获取外部图像

配置

模块的默认配置非常严格。
排除管理员用户或具有“绕过黑/白名单”权限的用户 - 模块的默认配置是拒绝所有获取外部图像的请求。
因此,要使模块正常工作,您需要访问 admin/settings/imagecache_external 以及:

Add some domains to the whitelist -or-
Switch the mode of operation from whitelist to blacklist

我希望这会有所帮助。

In Drupal 7 you already have Imagecache as a core module. All you have to do is to install Imagecache External. This is an utility module to allow you to use imagecache(D6)/image derivatives (D7) with external images.
After enabling the module, set the following permissions:

  • View external images
  • Fetch external images

Configuration

The module's default configuration is very restrictive.
Excluding admin user or users with the 'Bypass black/white list' permission - the default configuration of the module is to deny all requests to fetch external images.
So to get the module to work, you need to visit admin/settings/imagecache_external and either:

Add some domains to the whitelist -or-
Switch the mode of operation from whitelist to blacklist

I hope this helps.

旧故 2024-12-22 11:13:11

当我按照此过程进行操作时,我在本地远程 URL 上收到此错误

警告:为 element_children() 中的 foreach() 提供的参数无效(C:\Drupal Sites\BajaInsider\includes\common.inc 的第 6517 行)。
警告:drupal_render() 中存在非法字符串偏移“#children”(C:\Drupal Sites\BajaInsider\includes\common.inc 的第 5982 行)。

以及对同一变量的其他十几个非法调用...使用 NEX 主题模板作为核心。 Drupal 7.36,全部是最新的,没有核心模组,在本地测试。

When I follow this procedure I get this error on Remote URL locally

Warning: Invalid argument supplied for foreach() in element_children() (line 6517 of C:\Drupal Sites\BajaInsider\includes\common.inc).
Warning: Illegal string offset '#children' in drupal_render() (line 5982 of C:\Drupal Sites\BajaInsider\includes\common.inc).

and a dozen other illegal calls for the same variable... Using a NEX theme template as a core. Drupal 7.36, all up to date, no mods to core, testing locally.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文