1

In Drupal 7, I'm using the feeds module to pull in a bunch of books

That's all working perfectly. I am not setting up some views. the feed pulls in an image url to on o my field like this [http://img.techbook.com/techwords/content/bk/blak/003834/full_image.jpg but of course I need

<img src="http://img.techbook.com/techwords/content/bk/blak/003834/full_image.jpg" />

to display the image on the page

What is the best method of altering this fields' text, or is there a method so I can automatically format correctly. There are hundres of these, so manually do it is not an option

4

1 回答 1

1

您可以使用 Feeds Tamper,它可以让您在传入的 feed 数据进入之前对其进行操作(即用 img 标签包装 url):http ://drupal.org/project/feeds_tamper

或者

您可以简单地将 URL 导入到字段中,然后使用包含 img 标记的模板文件来呈现 URL。

像这样:在 node--content-type-name-here.tpl.php

<img src="<?php print render($content['field_url']); ?>" />

我会推荐后者,并且只使用 Feeds Tamper 进行更严重的操作。

于 2013-04-26T03:11:54.433 回答