Forums / Setup & design / site.ini in an extension for one site access

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

eZ debug

Timing: Jan 20 2025 04:05:34
Script start
Timing: Jan 20 2025 04:05:34
Module start 'content'
Timing: Jan 20 2025 04:05:34
Module end 'content'
Timing: Jan 20 2025 04:05:35
Script end

Main resources:

Total runtime0.1880 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 589.0859180.8125
Module start 'content' 0.00790.0124 769.8984102.0547
Module end 'content' 0.02030.1676 871.9531534.2500
Script end 0.1879  1,406.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00462.4301200.0002
Check MTime0.00221.1535200.0001
Mysql Total
Database connection0.00120.640510.0012
Mysqli_queries0.098252.26751410.0007
Looping result0.00100.55771390.0000
Template Total0.167188.910.1671
Template load0.00110.576110.0011
Template processing0.166088.327210.1660
Override
Cache load0.00070.371810.0007
Sytem overhead
Fetch class attribute can translate value0.00080.431510.0008
XML
Image XML parsing0.00030.133110.0003
General
dbfile0.036419.3622200.0018
String conversion0.00000.003830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs