Forums / Developer / Correct custom extension directory structure

Correct custom extension directory structure

Author Message

Emil Lazaro

Friday 26 October 2007 8:06:03 am

Hi,

I am experimenting with creating my own extension modules eZ, primarily going by the technical documentation available on the eZ site, and by looking at the existing modules and datatypes. There are a few questions that I had not been able to answer for myself by just reading the manuals.

From the documentation it seems that new modules should be built as extensions. The article I've been following is the Module tutorial (Part 1) (http://ez.no/ezpublish/documentation/development/extensions/module/module_tutorial_part_1). My intuitive understanding (although I never encountered it spelled out in these documents) is that one extension can have more than a single module. But here is the confusion : the article's author uses identical names for the extension directory and the directory where the module is placed, for example:

(/extension/mymodule)/modules/mymodule

then in module.ini.append file

[ModuleSettings]
ExtensionRepositories[]=mymodule

So in short my question is: can there be more than one module under one extension? If not, do the extension directory an the module directory always have to be named identically?

Maybe the answer is self-evident to more experienced eZ users, but I couldn't figure it out after a few trials and mostly errors.

Thanks

Heath

Friday 26 October 2007 1:34:22 pm

Hello Emil,

A few responses to your thoughts ...

1) Yes. Using the correct conventions of settings an extension may contain multiple modules.

2) Yes. For single module extensions you may see a common general pracice of the module name matching the extension name. This is not a requirement, mearly an over simplification. Pick a good unique name (watch out for using trademarks in the name :)

There is a limited namespace for module urls where each module should be named uniquely. It is possible that it would be more useful to choose carefully the name of your module which most closely matches your module (with thought on using the module name in urls for the views the module would provide).

Your well on your way :)

It might help to take study this article, http://ezpedia.org/wiki/en/ez/module

Cheers,
Heath

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

Xavier Dutoit

Saturday 27 October 2007 2:50:22 am

Hi,

That's common practice to add a prefix to your extension to avoid namespace clashes.

Eg: Heath would start with bc, someone from ez with ez...

X+

P.S. That's a convention, feel free to do otherwise, like I do ;)

http://www.sydesy.com

Emil Lazaro

Monday 29 October 2007 7:21:28 am

Thanks to both of you, I almost figured the answers on my own the hard way, your comments saved me some time.

Now I encountered a new issue that you may be able to advise me on: while I am testing a new datatype - a simple one I created as practice, every time I make a more significant change in the class file, I can not remove the old version of the class through the admin control panel. Even clearing the cache doesn't help. I figured the old version had to be removed before I made the changes, but I was hoping there would be an easier, smarter way.

Kåre Køhler Høvik

Monday 29 October 2007 11:22:35 pm

Hi

Please take a look at the eZ Network development guidelines as well. http://ez.no/services/eznetwork/development_guidelines The document also contains other information you might find handy.

Kåre Høvik

eZ debug

Timing: Jan 18 2025 11:25:59
Script start
Timing: Jan 18 2025 11:25:59
Module start 'content'
Timing: Jan 18 2025 11:26:00
Module end 'content'
Timing: Jan 18 2025 11:26:00
Script end

Main resources:

Total runtime1.1405 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.9766180.8125
Module start 'content' 0.00650.9724 769.7891647.0938
Module end 'content' 0.97880.1616 1,416.8828337.0547
Script end 1.1404  1,753.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00610.5388210.0003
Check MTime0.00160.1389210.0001
Mysql Total
Database connection0.00090.075810.0009
Mysqli_queries1.055192.51382040.0052
Looping result0.00250.21952020.0000
Template Total1.111697.520.5558
Template load0.00190.168920.0010
Template processing1.109797.296620.5548
Template load and register function0.00020.020310.0002
states
state_id_array0.00080.071910.0008
state_identifier_array0.00180.157620.0009
Override
Cache load0.00170.1486370.0000
Sytem overhead
Fetch class attribute can translate value0.00180.158550.0004
Fetch class attribute name0.00130.110180.0002
XML
Image XML parsing0.00210.187950.0004
class_abstraction
Instantiating content class attribute0.00000.001580.0000
General
dbfile0.00250.2229390.0001
String conversion0.00000.000430.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs