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

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