This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Setting the site design in PHP
expandshrink

Setting the site design in PHP

Setting the site design in PHP

Friday 27 April 2012 9:03:47 pm - 3 replies

Does anyone have an example on how to set the site design in PHP? Versionview.php seems to be doing something similair. For several reasons I don't want to create a new siteaccess to accomplish this.

$res = eZTemplateDesignResource::instance();
$res->setDesignSetting( $ini->variable( 'DesignSettings', 'SiteDesign' ), 'site' );
$res->setOverrideAccess( $siteAccess );

[...]

$Result = eZNodeviewfunctions::generateNodeViewData( $tpl, $node, $contentObject, $LanguageCode, 'full', 0, $viewParameters );

Tuesday 01 May 2012 10:12:41 am

HI.

Many of the interfaces used in this simply manipulate the (gasp..) big $GLOBALS array. Altering this directly can give you results that you want, but that is probably not the best option - especially since 4.5, there are some changes around this (resetGlobals depreciated, for instance).

 

Are you  trying to only change only the siteDesign itself (essentially adding a design directory higher in the order of precedence to pick up certain design elements) or do you need to override other items as well like actual overrides, etc)?

Wednesday 12 February 2014 10:52:49 am

Hello all,

I reopen the issue because I have the same kind of problems on a project 4.6. 
I want to move the design in mobile via php (because I am limited number of siteaccess).
I can change the design with this: 

 $GLOBALS['eZTemplateDesignSetting']['site'] = 'mobile';            $GLOBALS['eZTemplateDesignSetting']['standard'] = 'mobile';           
$GLOBALS['eZSiteBasics']['site-design-override'] = 'mobile';

But as the templates are cached, I can not make a classic design in a mobile design.
Any idea? 
(Knowing that I do not want to empty the cache pages every time ..)

Tuesday 03 June 2014 6:11:52 pm

There's no limitation for siteaccess and this is the fastest way blunk.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from