9526 Posts in 1941 Topics by 1529 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 454 Views |
-
Change Default Subsite

11 January 2011 at 5:00am
Hello,
although Subsites is not coded to work with SS 2.4, it works most the time. Anyway, maybe someone can give me some hints how to fix the following 2 issues, to make it work better with SS 2.4.
I have the following Subsites created:
SubSite A
SubSite B1) I created a user and put him into a "Content Editors" Group and allowed access to all Subsites (and languages). When the user logs in, always 'SubSite A' is active by default. How can I change this and make 'Main Site' the default after login? I tried to hard code, and to modify SubsiteList / currentSubsiteID, but without success
2) Furthermore I'm using Translatable together with Subsites. Every time I change the language on 'Main Site' or 'SubSite B', 'SubSite A' becomes active. Anyone got an idea how to fix this? (workaround would be great too).
-
Re: Change Default Subsite

4 November 2011 at 3:47pm Last edited: 4 November 2011 3:48pm
Anyone had any progress on this?
This has been an issue for me for editing child pages under RemodelAdmin. I just realized thanks to your post that the issue is that not the Main site but a subsite is forced for non-admins...
-
Re: Change Default Subsite

19 November 2011 at 6:09am Last edited: 19 November 2011 6:09am
I just did this - it may help. Under Subsite.php, there is a changeSubsite() method.
I set up my various ModelAdmin classes to work with numeric PageIDs and added a $subsiteID parameter.
<?php
class BlogAdmin extends RemodelAdmin {static $managed_models = array (
'ArticlePage'
);
static $url_segment = "blog";
static $menu_title = 'Blog';
public $showImportForm = false;
static $parent = 100;
static $parent_page_type = "ArticleHolder";
static $subsiteID=1;
}Then I just added this into the init funciton of RemodelAdmin.php:
public function init() {
parent::init();
...
if(($subsiteID = $this->stat('subsiteID'))>=0 ) {
Subsite::changeSubsite($subsiteID);
}
}It may not be orthodox, but it sure works, esp since I have article sections in several subsites managed with RemodelAdmin by different users.
I am guessing you could do the same and perhaps check what subsite needs to be set based on the user's group. Hope this helps anyone!
| 454 Views | ||
|
Page:
1
|
Go to Top |


