New extension to customize ezwebin [SOLVED]

Author Message

Lo' F.

Sunday 20 June 2010 1:50:17 pm

Hi there,

I created a new extension in the eZ 'extension' folder with the intent of overriding ezwebin layout with a custom one...

But it seems not to do what it is meant for.

Here are all the steps I did:

[root@ip ~] cd /var/www/vhosts/website.net/httpdocs/extension

[root@ip extension] mkdir eznew

[root@ip extension] cd eznew

[root@ip eznew] mkdir design

[root@ip eznew] cd design

[root@ip design] mkdir new

[root@ip design] cd new

[root@ip new] mkdir images stylesheets javascript templates override

[root@ip new] cd override

[root@ip override] mkdir templates
[root@ip extension] cp ezwebin/design/ezwebin/templates/pagelayout.tpl eznew/design/new/templates/
[root@ip extension] cp -rf  ezwebin/design/ezwebin/stylesheets/* eznew/design/new/stylesheets/
[root@ip eznew] mkdir settings

[root@ip eznew] cd settings

[root@ip settings] touch site.ini.append.php

[root@ip settings] touch template.ini.append.php

[root@ip settings] touch design.ini.append.php

eznew/settings/design.ini.append.php

<? /* #?ini charset="utf-8"?

[ExtensionSettings]

DesignExtensions[]=eznew

*/ ?>
[root@ip eznew] mkdir autoloads

[root@ip eznew] mkdir classes

[root@ip eznew] cd autoloads

[root@ip autoloads] touch eztemplateautoload.php

eznew/autoloads/eztemplateautoload.php

<?php

$eZTemplateOperatorArray = array();

?>

eznew/settings/site.ini.append.php

<?php /* #?ini charset="utf-8"?

[TemplateSettings]

ExtensionAutoloadPath[]=eznew

*/ ?>
[root@ip eznew] mkdir translations

[root@ip eznew] cd translations

[root@ip translations] mkdir ita-IT

[root@ip translations] mkdir eng-GB

[root@ip translations] cd ita-IT

[root@ip ita-IT] touch translation.ts

extension/eznew/translations/ita-IT/translation.ts

<!DOCTYPE TS>

<TS>

<content>

<span> </span><name></name>

<span></span><message>

<span></span><source></source>

<span></span><translation></translation>

<span></span></message>

</content>

</TS>
[root@ip translations] cp ita-IT/translation.ts eng-GB

eznew/settings/site.ini.append.php

<?php /* #?ini charset="utf-8"?

...

[RegionalSettings]

TranslationExtensions[]=eznew

*/ ?>

Activating the extension:

setting/siteaccess/public/site.ini.append.php

<?php /* #?ini charset="utf-8"?

...

[ExstensionSettings]

ActiveAccessExtensions[]=eznew

...

*/ ?>

Activating the design:

settings/siteaccess/public/site.ini.append.php

<?php /* #?ini charset="utf-8"?

...

[DesignSettings]

SiteDesign=new

...

AdditionalSiteDesignList[]=ezwebin

AdditionalSiteDesignList[]=base

AdditionalSiteDesignList[]=standard

...

*/ ?>

...How comes eZ doesn't apply the changes made in the pagelayout.css of this extension?

Any idea? Did I miss something?

Many, many thanks in advance!

loredanaebook.it

Gaetano Giunta

Sunday 20 June 2010 2:24:43 pm

- you can check if your ini files are correctly taken into account by looking in the admin interface, in the setup tab, 'ini settings' - pick the 'public' siteacces

- by enabling the debug output for the public siteaccess, you will find the list of used templates printed out at the bottom of the page

- I imagine you cleared the caches at least once after applying all your changes, right?

Principal Consultant International Business
Member of the Community Project Board

Lo' F.

Monday 21 June 2010 6:21:38 am

Thanks for your reply!

The ini settings of my public SiteAccess looks this way..

design.ini public SiteAccess:

[ExtensionSettings]

DesignExtensions

default [0]

extension:ezodf [1] ezodf

extension:ezoe [2] ezoe

extension:ezwebin [3] ezwebin

extension:ezgmaplocation [4] ezgmaplocation

extension:ezstarrating [5] ezstarrating

extension:ezwt [6] ezwt

extension:ezjscore [7] ezjscore

extension:ezmultiupload [8] ezmultiupload

extension:eznew [9] eznew

site.ini public SiteAccess:

[TemplateSettings]

ExtensionAutoloadPath

default [0]

extension:ezoe [1] ezoe

extension:ezwebin [2] ezwebin

extension:ezgmaplocation [3] ezgmaplocation

extension:ezstarrating [4] ezstarrating

extension:ezwt [5] ezwt

extension:ezjscore [6] ezjscore

extension:ezmultiupload [7] ezmultiupload

extension:eznew [8] eznew
[RegionalSettings]

TranslationExtensions

default [0]

extension:ezodf [1] ezodf

extension:ezoe [2] ezoe

extension:ezwebin [3] ezwebin

extension:ezgmaplocation [4] ezgmaplocation

extension:ezstarrating [5] ezstarrating

extension:ezmultiupload [6] ezmultiupload

extension:eznew [7] eznew
[ExtensionSettings]

ActiveAccessExtensions

default [0] 


ActiveExtensions

default [0]

override [1] eznew

override [2] ezmultiupload

override [3] ezjscore

override [4] ezwt

override [5] ezstarrating

override [6] ezgmaplocation

override [7] ezwebin

override [8] ezoe

override [9] ezodf
[DesignSettings]

StandardDesign

defaul "standard" 


SiteDesign

siteaccess "new" 


AdditionalSiteDesignList

default [0]

siteaccess [1] ezwebin

siteaccess [2] base

siteaccess [3] standard

- I am not sure I understand what you mean by saying "enabling the debug output"..

In the public siteAccess site.ini there is ..

[DebugSettings] 

DebugOutput override disabled

..but it doesn't allow me to change the default setting (in brackets it says value cannot be modified).

More precisely:

"

Predefinito (non può cambiare) - disabled

Impostazione SiteAccess - Nessun valore

eznew - Nessun valore

ezmultiupload - Nessun valore

ezjscore - Nessun valore

ezwt - Nessun valore

ezstarrating - Nessun valore

ezgmaplocation - Nessun valore

ezwebin - Nessun valore

ezoe - Nessun valore

ezodf - Nessun valore

Impostazione di override (globale) - disabled

"

... or maybe... I see... it's the "Debug Output" checkbox in the "Quick Setting" of the right area which I need to tick, is that right? And how that's supposed to show me the used templates?!

- Yes I did! I cleared all the caches after each and every change..

loredanaebook.it

Gaetano Giunta

Tuesday 22 June 2010 1:25:51 am

To change the debug settings, you have two options

- quick and dirty: use the buttons at the bottom of the right-hand column. Those allow you to enable debug either in a single siteaccess or globally (in the override configs)

- by hand: just open up site.ini.append;php (the siteaccess one or the override one depending on your specific need) and add at the bottom this block of code:

[DebugSettings]
DebugOutput=enabled
DebugRedirection=disabled
AlwaysLog[]=strict
AlwaysLog[]=debug
AlwaysLog[]=warning

[ContentSettings]
ViewCaching=disabled

[TemplateSettings]
DevelopmentMode=enabled
ShowUsedTemplates=enabled
Debug=disabled
ShowXHTMLCode=disabled
TemplateCache=disabled

[OverrideSettings]
Cache=disabled

This will

  • enable debug output
  • print list of used templates in the debug output
  • disable most caches
  • enable most logs

Principal Consultant International Business
Member of the Community Project Board

Lo' F.

Sunday 12 September 2010 1:04:04 pm

It took me a while to understand about eZ folders' structure, siteaccesses and settings but now I'm eventually there (or at least in the right track..) and I like to give a reply to this old post of mine as I've never liked to leave a matter unfinished!

By the way, once you enter into the system you realize how straightforward eZ is!

Alrighty then..

Created the "eznew" extension folders structure (above steps are made from the shell, but it can be done directly from the file manager inside the Ez extension folder - it might be easier..), added the settings in the .ini.append.php files in the "eznew"'s inner folders (for loading its design, template operators and translations - again as above), since I wanted it to be applied for all of the website's siteaccesses, I had to modify the global site.ini.append.php inside settings/override/

[ExtensionSettings]
ActiveExtensions[]
...
ActiveExtensions[]=eznew

..and, in order to activate the design, had to modify the site.ini.append.php of every siteaccess (e.g. ita - eng - chi...)

[DesignSettings]
SiteDesign=eznew
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base
AdditionalSiteDesignList[]=standard

So now I can customize the ezwebin extension by copying the original template in here and make the changes (..for all of this time I have been modifying the original files from ezwebin... time to restore it at its initial shape!)

loredanaebook.it

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 18 2025 05:08:16
Script start
Timing: Jan 18 2025 05:08:16
Module start 'layout'
Timing: Jan 18 2025 05:08:16
Module start 'content'
Timing: Jan 18 2025 05:08:17
Module end 'content'
Timing: Jan 18 2025 05:08:17
Script end

Main resources:

Total runtime1.0762 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0095 589.1641152.6406
Module start 'layout' 0.00950.0035 741.804739.4766
Module start 'content' 0.01301.0616 781.2813617.5469
Module end 'content' 1.07470.0015 1,398.828120.1250
Script end 1.0762  1,418.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3661160.0002
Check MTime0.00140.1306160.0001
Mysql Total
Database connection0.00200.183010.0020
Mysqli_queries0.961489.3270630.0153
Looping result0.00060.0576610.0000
Template Total1.016394.420.5081
Template load0.00570.526520.0028
Template processing1.010693.900920.5053
Template load and register function0.00010.009010.0001
states
state_id_array0.00130.125310.0013
state_identifier_array0.00210.198020.0011
Override
Cache load0.00550.50651050.0001
Sytem overhead
Fetch class attribute can translate value0.00050.046720.0003
Fetch class attribute name0.00150.140970.0002
XML
Image XML parsing0.00080.074120.0004
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.01621.5023220.0007
String conversion0.00000.000840.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
23content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
14content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 59
 Number of unique templates used: 12

Time used to render debug report: 0.0001 secs