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.

eZ debug

Timing: Jan 19 2025 06:12:51
Script start
Timing: Jan 19 2025 06:12:51
Module start 'layout'
Timing: Jan 19 2025 06:12:51
Module start 'content'
Timing: Jan 19 2025 06:12:52
Module end 'content'
Timing: Jan 19 2025 06:12:52
Script end

Main resources:

Total runtime1.2223 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.2891152.6406
Module start 'layout' 0.00620.0027 741.929739.4766
Module start 'content' 0.00891.2120 781.4063676.0469
Module end 'content' 1.22100.0013 1,457.453120.1250
Script end 1.2223  1,477.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2526160.0002
Check MTime0.00120.1009160.0001
Mysql Total
Database connection0.00090.070810.0009
Mysqli_queries1.156094.5773730.0158
Looping result0.00070.0598710.0000
Template Total1.190897.420.5954
Template load0.00230.187820.0011
Template processing1.188597.233020.5942
Template load and register function0.00010.007910.0001
states
state_id_array0.00090.071410.0009
state_identifier_array0.00120.097320.0006
Override
Cache load0.00200.1637360.0001
Sytem overhead
Fetch class attribute can translate value0.00050.043340.0001
Fetch class attribute name0.00090.0747100.0001
XML
Image XML parsing0.00330.268640.0008
class_abstraction
Instantiating content class attribute0.00000.0017120.0000
General
dbfile0.00260.2128310.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs