Forum OpenACS Development: Icons for CR_MIME_TYPES (relates to Media Package)

We have a situation where we want to display a lot of attachments in a small space. I'm thinking we could use icons instead of whole file names, so to do this I would add a table CR_ICONS to hold an image URL, and add a column to CR_MIME_TYPES for the icon ID. I'm not talking about changing every interface to the content repository to use these icons, but I think it's a nice option to have...
Collapse
Posted by Tom Jackson on

Icons is one of the things I wanted to use the Media Package for.

So far I have looked at the image content_type and the file-storage package (and content_type). I have yet to figure out how I can use CR to easily represent the rich variety of content types (their attributes) without hand writing lots of pl code. Both image and file-storage, and extlink, have lots of hand written code, much more than I am willing to invest in a generic package. They also have datamodel, and I got a few comments that using the CR would be relatively free from that.

From what I can figure, I would only have one content_type in CR: media_type. But I need a separate datamodel for each type. It seems that if I use the CR I'll have to do 3 or more separate lookups to get to the media, since CR already requires two. What I need for the Media Package is to be able to calculate the url of a Media object without a database lookup (assuming it exists), or to provide a list of media types and the number of media of each type in a single lookup.