Forum OpenACS Development: how to change template or skin

hi

can any body help me out how to change the template or skin programatically, one thing i know is we can change it by going to the site-map and click on subsite (parameters) there we can give it directly.

but i want to change it programatically, as i want different templates for different languages.

thanks in advance
regards
vamshi

Collapse
Posted by Jade Rubick on
I believe you can set this in your .adp file, by calling a template with a src='' parameter. You could set what this is in your .tcl file, pass it to the adp file, and then it would be set dynamically.

That's my best guess at least.

Collapse
Posted by Tilmann Singer on
Normally when there is a tcl and an adp file for a url, first the tcl file is processed and by default the corresponding adp file is then used for rendering the result. It is possible though to override this per request by including a call to 'ad_return_template alternative-file' at the bottom of the tcl page.

You can do the same in the default-master.tcl file:

...
set language "en"
ad_return_template "default-master-$language"

at the bottom of default-master.tcl will result in the templating code to look for a file called default-master-en.adp instead of the usual default-master.adp. Hope that helps - if not try to tell us more what you need to do.

Collapse
Posted by VenuMadhav Deevi on
hi thanks for the idea
i will try to implememnt it
one more question please

how to set the parameter which will be there in the site

we can acess that one by this command which i know

set tmp [ad_parameter body]

i am getting the content of the body, how to set the content of the body now is my question,

with GUI i know how to set it but programatically i want to set it.

please help me

thanks
vamshi

Collapse
Posted by Tilmann Singer on
How to find tcl procedures that do what you want: go to /api-doc/ of your local installation, type in a meaningful search term, e.g. 'parameter', and go through the results. In this particular case you have been looking for the proc parameter::set_value. ( https://openacs.org/api-doc/proc-view?proc=parameter%3a%3aset%5fvalue )

Note that procedures with :: in it are generally preferred because they use the more modern namespace feature and are propably newer.

An addition to the default-master hint above: I noticed that it won't work for pages under www/, unless you specify a full path like this:

ad_return_template "/www/default-master-$language"

Collapse
Posted by VenuMadhav Deevi on
thanks
Tilmann Singer  i would be working on it