Forum OpenACS Q&A: Advice Sought from Experienced ACS'er (CR)

Hi All,

I have a fairly pressing requirement to complete that involves the CR, and I could do with some advice as the best way to proceed.

Let me briefly outline the problem-space.

I'm putting together a custom, content management section, for a new site. The idea is that a user of the site can, via some on-line screens create a number of text and image elements describing their company and can then select from a number of display templates to determine how the page will appear when served up.

Typically the user will create a 'description' item, a 'capability list' and probably include a corporate image.

I intend to offer them each as a separate item to maintain, so that the task of doing so could be separated amongst distinct users. The final 'approval' or 'publish' step will be performed by the site administrator who will essentially control if new revisions can become the live revision.

The Problem

The 'capability list' is an item consisting of one or more list entries (plain text) but with the possibility of attaching an image.

Ok, I could model where each list element is itself a separate content item, as is each image, and therefore relate them to each other (image being the child of list element perhaps).

That's ok ish, but its hard to imagine a UI to accompany that that would not be cumbersome. (and the users are not necessarily that web-savvy)

What I'd really like to offer is a single text entry box where the list can be produced, and when an image is desired they can just put in a simple directive naming the image.

Therefore the template would have to, when constructing the page, replace these directives with the relevant image.

Ok, that in itself is clear enough, but then the issues arises of how to get the images into the system

I could have an 'add image to image bank' screen, where they can upload images (Stored in the CR?) that can then be reference by name. (of course the name would have to be made unique within the context of that user).

Question: This seems fairly do-able, but what concerns me is the template itself. I've used the CR a bit before, but not with any great aggression, so although I'm sure this is acheivable I'm not entirely sure how the template would operate.

Does anyone have an example of this sort of thing, or some advice, or even a suggestion for an alternative approach to how this might be achieved?

I guess really this is highlighting my lack of usage of the CR. Creating fairly strict, fixed size and content stuff is straightforward, but the docs and example are a little thinner on the ground when it comes to creating CR based docs that have fairly arbitrary content where you want the user to have control over that.

If anyone has examples (and I will respect confidentiality/NDA if its commercial) I could work from etc.. I would be deleriously grateful.

Thanks in advance
Simon

Collapse
Posted by Ben Koot on
Hi Simon,

What about combining photodb and Wimpy. Use the view/upload attachments function in Wipy, and instead of refering to a local harddisc, refer to photodb as imagebank to add images to the content page.

Cheers
Ben

Collapse
Posted by defunct defunct on
I'm not sure that would be suitable (but I'd need a bit more detail about what you're suggesting).

I need to manage all the content locally, as part of the CR, as there's a high degree of interconnectivity with the rest of the site. Primarily for things like searching, but also because the rest of the application is based on a highly inter-dependent data model.

Also, portions of this site are already in place and making extesnive use of the CR, so I'm stuck with needing to generate complex CR templates I think, and this is the tricky bit ( I think ).

However I may be misunderstanding what you're saying, so perhaps you can explain a little further?

Collapse
Posted by Dave Bauer on
Simon,

You can store the template information in the CR with the main item. Then the rest of the content can be child items to that one. Use the cr_item_template_map. This can also have a use_context which defines a template depending on how a content item is being "used". You can also define templates per content_type, but in your case, per item is better.

Next you can use an index.vuh to read in the template name and do
ad_return_template $template_name

or probably more likely rp_internal_redirect because you will need to
process the tcl file associated with the content template you are returning.

This way the URL would not have to contain information about which template is to be returned, that is stored with the content item.

In each template's tcl file you have code the pulls out all the various pieces into tcl variables, and then assemble them in the adp.

It's kinda early, does this make any sense?

Collapse
Posted by defunct defunct on
It does, Thanks Dave, and also thanks to those who posted suggestions direct.