Forum OpenACS Q&A: Response to Content Repository/CMS

Collapse
Posted by Dan Wickstrom on
I don't recall that there was any documentation on this, but after some trial and error while debugging the cms, I think I understand how it works now.

First thing, you need to go to the cms interface and upload an image into the CR. Next associate a template with the image, and make the new revision the live revision. For testing, I've been making a default template that I use for both basic content items and images. It looks like the following:

<html><body><content></body></html>
Next you need to access the image through its virtual url. If cms is mounted at http://yourmachine/cms, then you can access the image at http://yourmachine/cms/item2976 (assuming item2976 corresponds to the image that you uploaded). Once you do that the image gets published to the file-system, so you can now go to [openacs root]/www to view the image from the file-system. Depending on whether the image is a gif or a jpg, the appropriate extension will be appended to the name. So you will see something like item2976.jpg in the [openacs root]/www directory.

Once you've done all that, you can now reference the images in your content items using a relative url:

	<img src=/item2976.jpg>

There are some problems with doing it this way, because each time you change the image you need to make sure and go to the virtual url and access it or it won't get published to the file-system. If, you're not worried about accessing content with something like frontpage,then it is simpler, because you can use the virtual url for the image in your content items, and you won't have to worry about the revised image being published to the file system. Just use an img tag like the following:

	<img src=/item2976>