Community

Make an URL return the *content* of an image field in the latest published content of a give type?

Hi folks,

I tried to be both complete and concise in the subject, but I guess some explanation is required. :)

I have a Drupal 7 site which essentially contains a (translation of a) webcomic. It has book pages, and each book page has a single image field. Book pages get added at a cruise speed of two pages per week.

Now I have *another* site, not necessarily Drupal, where I want to link to "the miniature of the latest page of the webcomic site". The link will be used within a HTML 'img' tag, therefore it must be a URL (e.g. '/latest') that returns a minature of the lats page's image -- not the whole webcomic page, not a web page, the image. Each time a new book page is added on the webcomic page, the URL itself should remain unchanged but the content returned by the URL should be that of the newer page. IOW, here is an example:

  1. On the 'webcomic' site, page 100 gets published.
  2. On the other site, <img http://webcomic/latest> returns the miniature of the image in page 100.
  3. On the 'webcomic' site, page 101 gets published.
  4. On the other site, <img http://webcomic/latest> returns the miniature of the image in page 101.

etc.

I can't find a way to do this. Anyone has an idea on how I can achieve this?

Thanks in advance,
Albert.

Comments

Views?

One of the options in views is "feed".

Can you make a feed that shows the single image field (field) for the most recently published (filter, limit to 1) webcomic (content type)?

Then you can feed that example.com/feed/latest.xml url to the other site, which will have to parse the XML correctly. If it is another Drupal site, use the Aggregator module to pull it in. The updating is at the mercy of the frequency in which the xml file is re-loaded on the "other" site.

Feed is the backup plan

Thanks for your reply.

Indeed, I could use a feed display in Views, but as you explain that puts some burden on the site which links to mine and might fall out of sync with the comic updates; that's why I would like a simpler solution where the linking site just points to a URL without having to do any processing, and the miniature gets updated directly from my site. If there really is no such solution then I'll fall back to providing an RSS feed.

nobody click here