site.ini in an extension for one site access

Author Message

Greg McAvoy-Jensen

Wednesday 18 July 2007 11:38:12 pm

I'm trying to do a design extension which will include all my custom templates (including pagelayout.tpl) using eZ Publish 3.9.2. I want to pass variables (for example, specify the SiteDesign and AdditionalSiteDesignList) in the site.ini.append.php from within the extension. However, since I don't want the admin site access affected, I'm calling the extension using ActiveAccessExtensions.

The extension is being called, but the extension's site.ini.append.php variables aren't being utilized. Any idea why? Is there a better way to do this?

Thanks!

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Christian Johansen

Thursday 19 July 2007 6:31:02 am

Hi,

I recently had exactly the same problem as you. It seems that if you enable ActiveExtensions[] in your siteaccess site.ini it works as intended. However, if you exclude the ActiveAccessExtensions[] the extension is not loaded. Seems to me that the whole extension loading thing should be revised as it is currently very confusing. I don't really see the point in having different settings for siteaccess/xxx/site.ini and override/site.ini anyway.

My setup is like this:

In settings/siteaccess/<mysite>/site.ini.append

[ExtensionSettings]
ActiveAccessExtensions[]=myextension
ActiveExtensions[]=myextension

This enables me to put all the settings and design inside the extension without messing up the admin. This also enables you to keep all settings that are shared between all siteaccesses except the admin in one place which is very useful for sites with different siteaccesses that are really only translations.

Greg McAvoy-Jensen

Thursday 19 July 2007 10:10:36 pm

Christian,

Thank you. Yes, I had read your and other posts related to this problem. I tried the technique you suggested--essentially adding the variable ActiveExtensions, which is designed to be in override/site.ini, to siteaccess/.../site.ini, along with ActiveAccessExtensions. But the site.ini settings (site design, site name) in the extension still don't take effect, even after clearing the cache.

The other settings (override.ini, design.ini) continue to be effective, as they were before.

Other thoughts? Thanks!

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Christian Johansen

Thursday 19 July 2007 11:34:08 pm

Strange, it works for me. Have you tried to remove the settings from the siteaccess/<yoursite>/site.ini.append file to see if the extensions file settings are used?

You can also try the ezini operator directly in a template and "fish" for some settings to see what you get. One thing you should be aware of is that the admin ini settings inspector will not be able to see the ini settings for your siteaccess correctly when some of them are loaded from an extension when the extension is enabled in this way.

Xavier Serna

Friday 20 July 2007 2:55:13 am

There is a tip that can help you to see the loading order of the different settings folders. In index.php, add at bottom this:

print_r($GLOBALS["eZINIOverrideDirList"]);

and you would see the order in wich the settings are applied.

hth!

--
Xavier Serna
eZ Publish Certified Developer
Departament de Software
Microblau S.L. - http://www.microblau.net
+34 937 466 205

Heath

Friday 20 July 2007 3:40:57 am

This thread has a good example of the output suggested,
http://ez.no/community/forum/developer/siteaccess_in_extension_settings_loaded_twice

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Greg McAvoy-Jensen

Friday 27 July 2007 9:42:27 pm

You were all very helpful. In short, I had expected my extension's ini settings to take precedent over everything except settings/override; in reality, for a single site-access extensions, it has much lower priority. Thank you!

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.