Article

eZ publish: PHP's Killer App - Parts 1-3

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Next

Part 2

In Part 1 of this series, I introduced you to eZ publish and dared to dub it "PHP's killer App". By the end of the last article, you'd installed eZ publish on your development system and of course, being extremely diligent, you've done all the homework set and know what eZ publish has to offer.

By now though, you're probably wondering how to change that boring grey background and apply your own design. In this article, that's exactly what I'll explain: how to make eZ publish look and behave the way you want it to. I'll be helping you create a fictional Website called "phpPoint" which will act as a demonstration of how you can customize eZ publish.

Today's specials are:

  • Fools rush in: pre-requisite knowledge about the eZ publish directory structure, the site ini file and the caching system.
  • Going Global: how to modify the "global" design of eZ publish and how Sections are used to create multiple sites.
  • Hitting the Module: here you'll see how module customisation works. Concentrating on eZ Article, you'll see how to use it's "API", how to modify it's templates and how to use static pages, URL translation and forms.
  • phpPoint Finished: the happy ending!

By the time you're finished, you'll know all you need to build your own state-of-the-art eZ publish site using the existing modules.

Fools Rush In

Ok. Before you starting hacking away, there are a few things that are worth having a look at so you know where you are.

The eZ publish directory structure

If you open up your eZ publish installation directory C:\phpdev5\www\public\ezpublish_2_2_6\ (or wherever you installed it) with Windows Explorer you'll see a long list of subdirectories. Most of these relate to eZ publish modules -- they're easy to spot because they all look like "ezsomething", for example: "ezarticle", "eztrade" and "ezforum". I'll come back to module directories later, but first, let's look at some other important directories and files:

  • admin directory: This contains code and templates for the general look and feel of the eZ publish administration back end. Modules add further code for specific admin tasks, stored under their own directories (as you'll see shortly). I'll leave this directory alone though, as I don't care so much what the admin interface looks like: it's private after all. One thing to note is that any "intl" directories you might come across contain files that allow eZ publish to handle languages other than English -- you'll be seeing more of this later.
  • checklists directory: If you really got stuck into the homework from the last article, you'll already know that this directory contains a set of tests that you can run on the eZ publish modules. eZ publish still has some minor bugs, as you might expect with an application this big. If you run into any problems, and you're sure it's not your configuration, have a look at the eZ publish Bug Tracker.
  • classes directory: This contains general PHP classes that are used throughout eZ publish, as described at http://developer.ez.no/doc/view/index. If you're just interested in applying your own design, you don't need to worry about these. I'll look at them in more detail in the third article of this series. Underneath the classes directory you'll also find the all-important cache directory. We'll cover more on caching in a moment, but you need to be aware that this directory caches the global configuration files like site.ini.php.
  • images directory: Contains images used throughout eZ publish. Further images appear under the module directories.
  • sitedesign directory: This one is important, as it contains the files that determine the overall eZ publish design. We'll look at this in depth shortly.
  • site.ini.php file: This stores the global configuration options for eZ publish. More in a minute!
  • sitedir.ini file: Used by eZ publish to locate itself for installations, as you saw in part one.
  • cron.php file: A useful file that helps with scheduled updates to eZ publish while you sleep! Intended for the Unix Cron tool (it should also be possible to activate this using a Windows scheduling tool, such as the Task Scheduler).
  • index.php file: This is the "traffic cop" of eZ publish, activating code as required. It should never need changing -- any attempts to do so will probably break things unless you know what you're doing.
  • index_admin.php file: This is the "traffic cop" for the back end admin system. Again, best not to touch!
  • index_xmlrpc.php file: This provides and XML-RPC interface to eZ publish, for use with their Desktop Edition. Not one you should need to interfere with.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links