Forums / Setup & design / 3.5 Design Look and Feel SiteAccess Selector

3.5 Design Look and Feel SiteAccess Selector

Author Message

Luc Chase

Friday 08 April 2005 10:59:49 am

How can I add a SiteAccess Selector to the Look and Feel screen? It's available in several other places and it seems it ought to be there too.

The Web Application Service Provider

Frederik Holljen

Monday 11 April 2005 7:35:54 am

That functionality requires some code to be added. This functionality will most probably be improved for eZ publish 4.0.

Luc Chase

Monday 11 April 2005 1:31:01 pm

Ok, thanks Fredrik. Over the weekend we found how to make it set Look & Feel for the Current SiteAccess only (instead of a Global Override). Two simple line changes in the Kernel. Also, had to change one more line so that the SiteName is also set for the current SiteAccess only. Works well because we already allow simple edits from the user-site SiteAccess, but of course it would still be better if we could use a SiteAccess Selector instead; then it could be used from the Admin SiteAccess instead of only from the user-site SiteAccess.

The Web Application Service Provider

Esteban Rodriguez

Tuesday 12 April 2005 10:05:29 am

I think we've found a "cleaner" way to do this. You have to do it on every site though.
If you edit the "Template Look" class, you'll find that you can choose on which SiteAccess each inisetting will be modified, just pick the siteaccess for the particular site and voilĂ , you're done.

HTH.

Esteban

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Luc Chase

Tuesday 12 April 2005 3:44:46 pm

Esteban,
yes that is true. But in the method I used you actually get another SiteAccess in the datatype of the class called 'CurrentAccess' (just below 'override')so don't need to edit it for each site.
However, haven't yet found how to make the Banner Image SiteAccess Specific.

The Web Application Service Provider

Esteban Rodriguez

Wednesday 13 April 2005 8:42:49 am

Ok, sounds good.
On the other hand, now I realize that doing what I said we still can't avoid having the Template Look edit the design.ini in the override dir, instead of the one in the current siteaccess.
This is somewhat of a problem, since it makes it harder to administrate several sites with one install.

Any clues?

Esteban

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Luc Chase

Wednesday 13 April 2005 11:12:16 am

That,a where the three Kernel edits come in. But still working on getting the Logo to be site specific. ThenThe menu layouts next...

The Web Application Service Provider

Esteban Rodriguez

Wednesday 13 April 2005 11:25:30 am

Ok, Luc, could you show me what you edited in the kernel?
I'm generally quite afraid of touching the kernel, since I don't want to spoil upgradeability, but I really need to have this solved.

Thanks,

Esteban

I have great faith in fools; self-confidence my friends call it.

http://presencia.net

Luc Chase

Wednesday 13 April 2005 1:51:49 pm

Ok this is as far as we've got. Remember this only works if you edit while in the site access you want to change (not while in the Admin siteAccess).
Change line 134 of ezpackagetype.php from

$iniPath = "settings/siteaccess/$siteAccess"; 

to

$accessArray = $GLOBALS['eZCurrentAccess'];
$access = $accessArray['name'];
$iniPath = "settings/siteaccess/$access"; 

next change line 332 (I don't know yet if Line 195 might also benefit from a similar change ) of ezinisettingtype.php from

$path = 'settings/siteaccess/'.siteAccessArray[$iniInstance];

to

$path = $iniInstance == 1 ? 'settings/siteaccess/' . $GLOBALS['eZCurrentAccess']['name'] : 'settings/siteaccess/' . $siteAccessArray[$iniInstance];

then change line 601 of the same ezinisettingtype.php file from

$siteAccessList = 'override';

to

$siteAccessList = 'override;currentSite'; 

then edit the sitedesign class (the one for the choice of designs)to use 'currentSite'
We're also making progress with siteAccess specific Logo changes but it's quite long winded and too early to call it a solution.
Please don't blame me if the above totally mucks-up your installation. If and when it's all done, dusted and tested I'll publish the whole thing as a clean extension with instructions etc.

The Web Application Service Provider

Esteban Rodriguez

Wednesday 13 April 2005 2:20:08 pm

Gee, that was quick, thanks for the trouble.
Rest assured I won't blame you if I screw up. I'll post whatever develoments we can get starting off from what you've changed.

thanks,

Esteban

I have great faith in fools; self-confidence my friends call it.

http://presencia.net