Forum OpenACS Q&A: Re: make dotlrn a subsite

Collapse
2: Re: make dotlrn a subsite (response to 1)
Posted by Iuri Sampaio on
Well,
I developed kind of a trick, that you just choose your "site-master-kelp" page acording with the community id that you are on, then for each comunity i have a diferent main page(in your case would be "[ad_con url]" getting the exactly url you want to have the page, in the case you are not loged in) .
I believe it could be useful to your or inspire you to do something similar.
the code is on the tcl file "dotlrn/dotlrn-master-kelp.tcl" and on the adp it call the master tag as a variable.
I better show you the code then you can understand better what i've said.

on the tcl file:
************************

# Figure out which master we want to use
# We can do it in two ways, one manually and the other_one with db_access

# Mannually:
# Just set a list of community_id's
# example:
# set community_list [list 11223 21334 83502]
#
# Database:
# We can do a query for communities
# example:
# set community_list [db_list get_communities { select community_id from dotlrn_communites where\
pretty_name in ('YABT Brasil','YABT Peru','Yabt Guatemala') and community_type = 'dotlrn_commun\
ity'}]

# Set the community_list for the special layout
set community_list [list 24688 83502 3921]

# Get the current community_id
set community_id [dotlrn_community::get_community_id]

# Make the comparisson, if is not present on the list then the search returns "-1"
if { [string equal [lsearch -exact $community_list $community_id] "-1"]} {
set master_src "/www/site-master-kelp"
} else {
if { [string equal $community_id "3921"] } {
set master_src "/www/site-master-yabt"
}
if { [string equal $community_id "83502"] } {
set master_src "/www/site-master-yabtbr"
}
if { [string equal $community_id "24688"] } {
set master_src "/www/site-master-infobizarg"
}

}
****************************

on the adp: first line
******************************
master src=@master_src;noquote@

i hope it is useful