简体   繁体   English

Drupal内容图片URI

[英]Drupal Content Image URI

I'm trying to theme a view in Drupal 7. I have the view theme set-up and it is working fine. 我正在尝试在Drupal 7中为视图设置主题。我具有视图主题设置,并且工作正常。 The issue that I have is that I can't see a way to override the $content variable passed into the render() function. 我的问题是我看不到一种方法来覆盖传递给render()函数的$content变量。

Is there a pre/process hook that I should be using or should it be done in a .tpl file using the $node variable? 是否应该使用前/过程挂钩,还是应该使用$node变量在.tpl文件中完成?

Currently I'm looking at the $node variable but the image attached to the content has a url of public://field/image/imagefield_JmDqqm.jpg and I've not been able to find a function (so far) that will parse that url into the correct url to view the image on the page. 目前,我正在查看$node变量,但附加到内容的图像的URL为public://field/image/imagefield_JmDqqm.jpgpublic://field/image/imagefield_JmDqqm.jpg ,我还没有找到可以解析的函数将该URL转换为正确的URL,以查看页面上的图像。

Thanks for any and all help. 感谢您提供的所有帮助。

file_create_url函数是您所需要的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM