Forum OpenACS Development: An answer to applying different templates based on package instance?

The content repository allows the assignment of templates based on content folder or per content item.

If a package created a folder for each instance, a different template could be applied based on the folder.

Hi Dave,

Was this post supposed to on another thread or a new one? Anyway to add to what you have said.  Each template can have a context.  That means you can assign 2 or more templates on a single content item and each template can have different context.  Say one template is context 'public' and the other is 'intranet'.

The current CMS that I am working on is already capable of what you have stated and what I have stated is in the works.  This is the current implementation:

if [get_template -item_id $item_id -context public] {
  ad_returntemplate $template
} elseif {get_template -item_id $parent_id -context public] {
  ad_returntemplate $template_of_folder
} else {
  ad_returntemplate $default_template
}

There is also a big if that checks if its printer friendly.

You can also apply templates on a per content type basis, I haven't check on this yet.