Archive for the Category eZ Publish

 
 

eZ Publish Tutorials

Over the coming weeks I will publish a number of short tutorials and information pieces to provide assistance to new community members who are looking for more information or need a plain English explanation of how to undertake certain tasks or projects with eZ Publish. Time permitting I will try to make an examples real-world examples rather than abstract ones.

Hopefully over the coming months I will be able to tidy these posts up further and publish them in a cohesive order over at the Quiqcorp site in our new documentation section which should be launching over the Christmas period.

I have a number of topics already on my list but I am happy to take suggestions from anyone else looking for specific tutorials.

Cell specific CSS design

As sites become more complex and segmented we continually see new ways to approach the design and layout of these sites. Quite often you see designers resorting to additional divs, classes and ids to try and identify areas within the site, which in many cases are semantically the same as other areas… but how do we style them?

One of the simplest and easiest ways to preserve and simplify your templates, classes and ids is to identify your subtree and node id in your body tag. Setting these classes allows your CSS editors to quickly identify and write custom selectors for specific areas of your site whilst not needing to modify multiple templates.

An example of doing so would be:

<body class="node_id_899 subtree_node_id_167">

The above can be generated from pagelayout.tpl providing your CSS editors a quick and easy method for identifying their current location and can style accordingly.

Bruce Morrison on Errors can be misleading…

Bruce has a great post over on his Stuff and Nonsense blog about eZ Publish not displaying database connection errors but instead responding with an access denied message.

I think I would prefer to see eZ Publish resort back to an “Oops” or “Our site is under maintenance” display in the case of failed database connections, in preference to seeing either a no database error or access denied, both of which have negative impacts on visitors.

As a point of interest the admin design does display Error 50: No Database Connection on the login screen when a database connection is not present.

Visit the original post here.

iPaper

It’s been almost 6 months since I thought of writing an eZ Publish extension for the Scribd iPaper service but travel and client work has kept my hands tied. Last weekend I found a few spare hours to start working on a new extension called qcScribd which will provide integration into the Scribd API, support for workflow processing of new documents, delayed publishing until documents are displayable, a new datatype for handling licensing, advertising and private settings as well as javascript embedding of the iPaper throughout your eZ Publish site.

The 1.0 release is almost complete and over the following few days I will ready the code and release it back to the community in its new home at http://projects.ez.no/qcscribd

eZ Systems Flash Player

I’m not sure if it’s just me or not… but I’m pretty sure that the flash player on use throughout the eZ Publish and eZ Components sites has terrible memory leak problems.

If I load up one of those videos and watch it immediately I usually escape too much harm, but if you happen to load it up and pause it for any period of time check on your CPU usage.

I noticed this when my the temperature on my laptop raised to 72 degrees celcius and Safari became slower than sloth.

Has anyone else experienced this issue?

Ooops

Seems I let my blog posts slip again, it is much the same as a New Year’s resolution you make and know you will never keep.

I have been keeping busy over the past few weeks and will put together some posts on my more recent eZ Publish thoughts over the coming days. This will include some new deployment methods we are using at Quiqcorp for creating new development environments on the fly.

I also note that Kristof Coomans is releasing a new eZ Publish 4 version of his Akismet extension based on the Services_Akismet PEAR module which will be great to see, that’s one thing I can cross of my list if someone else is implementing it :)

Quiqcorp achieves Gold Partner status

Yesterday I was pleased to receive an email from the eZ Partner Team informing us we had reached Gold Partner status which is a great achievement for our team and something we couldn’t have achieved without the dedication and passion of our staff.

Over the coming 6 months we look forward to actively pursuing new eZ Publish opportunities, providing improved and comprehensive training materials for the greater eZ community, releasing some of our developments back to the community and persuing that Platinum partner status.

Flip the comment order on blog posts

By default in new installations of eZ Publish using the ezwebin or similar packages you will have access to the blog, blog post and comment content classes – there are everything you need to get started with your own blog on eZ Publish.

As I built out this site one of the things I noticed with the blog_post.tpl was that comments were being displayed newest first, in the same manner they are on the eZ Publish website, this seems a little counter-intuitive to me and certainly breaks the design pattern established by most other blogging tools available.

To flip the order of your comments to chronological order, oldest first you can approach this in two different ways. You can modify the fetch that pulls back the comments and sort_by the published date, which is what happens by default, you just need to change the ascending/descending option.

The alternative is to accept the default fetch if that is beyond your knowledge and modify the template using the reverse operator to flip the resulting array from your fetch.

I have posted an example below of how this could be done.

{foreach $comments|reverse() as $comment}
{node_view_gui view='line' content_node=$comment}
{/foreach}

I haven’t had a chance yet to run performance tests on each implementation although I believe that the modified fetch function will be faster than array reverse within template code. Over the coming weeks I will have a chance to confirm this.

Comments fixed

Big thanks go out to Nicolas Pastorino for mentioning to me the other day he had registered here on the blog and was unable to post comments.

I have since resolved this permissions issue so commenting should be allowed for both anonymous and registered users. It does however make me stop and think about new ways in which I can test and build out deployment guidelines that cover issues like this.

In any normal development process you have clients testing and revising your work, which of course didn’t happen in this case until Nicolas mentioned it to me. Any suggestions as to how you handle the large number of tasks required for an eZ Publish deployment?

Update: Well it seems it didn’t take long for comment spam to show up. I will lock down comments to registered users only until I put other measures in place to look after comment spam.

eZ Publish Advanced Content Management Book released

eZ Press recently released a new book, eZ Publish Advanced Content Management, which was authored by Bergfrid Marie Skaara and Peter Keung.

I received my copy last week and I am looking forward to having the spare time in coming weeks to thoroughly read and review its contents. It should be interesting to see how this publication fits into the greater education of eZ community and partner members.

eZKeyword Autocomplete

Nicolas Pastorino recently released the eZKeyword Autocomplete extension for eZ Publish 4 and I decided to give it a whirl.

Installation of the extension is very straightforward:

It doesn’t get much easier than that, but unfortunately it didn’t work. A quick review of the module.php showed that /ajaxbackend/autocomplete_keywords was being queried for keyword results. On loading up this url I encountered a PHP Fatal Error.

	 [Mon Jul 07 23:51:17 2008] [error] [client 202.0.51.250] PHP Fatal error:  Call to undefined function json_encode() in /home/andrewdu/public_html/extension/ezkeyword_autocomplete/modules/ajaxbackend/autocomplete_ezkeywords.php on line 66

It appears that the script was unable to find the json_encode function. Doh! json_encode was only added to PHP 5.2, which leaves a few of us still on PHP 5.1 with an extension that doesn’t work. Of course we can soon rectify this issue by providing a fallback function incase the json_encode function is not available on your system. I patched ezkeyword_autocomplete/modules/ajaxbackend/autocomplete_ezkeywords.php with the following function.

	if (!function_exists('json_encode'))
{
  function json_encode($a=false)
  {
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';

    if ($a === true) return 'true';
    if (is_scalar($a))
    {
      if (is_float($a))
      {
        // Always use "." for floats.

        return floatval(str_replace(",", ".", strval($a)));
      }

      if (is_string($a))
      {
        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';

      }
      else
        return $a;
    }
    $isList = true;
    for ($i = 0, reset($a); $i < count($a); $i++, next($a))

    {
      if (key($a) !== $i)
      {
        $isList = false;
        break;
      }

    }
    $result = array();
    if ($isList)
    {
      foreach ($a as $v) $result[] = json_encode($v);
      return '[' . join(',', $result) . ']';

    }
    else
    {
      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
      return '{' . join(',', $result) . '}';

    }
  }
}

The above takes care of our json_encode issue and the script should now work. Autocompletion of the keywords ensures that you pick appropriate existing keywords each time rather than cluttering up your keywords with many similar keywords.

In summary the extension works well and thanks should go out to Nicolas for such a great contribution.

Anglican Taonga website launch

Anglican Taonga, a magazine published by the Anglican Church in New Zealand, approached Quiqcorp back in late 2007 regarding the opportunity to web-enable their magazine. They were looking to take the next step in the evolution of communication and try to provide materials to their readership in a shorter timeframe with the ability to cover more features than possible within a usual print setting.

The result of this collaboration is Anglican Taonga, a simple but effective eZ Publish 4.0 deployment to suit the requirements of the client. In addition, they can grow into this solution as additional areas of the Church look to expand their online presence.

eZ XML/OE stole my line breaks

I am currently working on implementing syntax highlighting for my blog to make it easier to post snippets of code, at the moment they are less than readable.

I have built out new template operators and handled the syntax highlighting, but I have one niggly little problem prior to actually using the highlighting. It seems everytime I paste code into the literal tag within eZOE it strips out the line breaks. This unfortunately renders multiple lines of code into a garbled mess, essentially the same point I was at prior to wasting my time on this :)

I have played a little with the ezoe input parser and similar files but have yet to figure out why line breaks are stripped out, or why they are not recognised when pasted in as opposed to entered manually with shift+return.

If any one has any insight into this delightful little problem I would love to hear it.

eZ Publish DateTime Operator Missing Ordinal Support

In redeveloping my blog over the past days I came across the fact Ordinals are not supported by the default datetime implementation in the eZ Publish template language. While I consider this an important function, it is of course the first time I have gone looking for it ever… strange.

In any case some people will be asking, “What is an ordinal?”. Ordinals are a 2 letter english suffix that are often added to days of the month “st, nd, rd, th”. PHP supports these functions using the ‘S’ character in the date function. Unfortunately eZ Publish 4.0 does not support handling the ‘S’ character in the datetime template operator.

I have lodged an enhancement request on the issue tracker at http://issues.ez.no/13300

I haven’t submitted a patch for this enhancement as yet, and due to a lack of time I haven’t had an opportunity to investigate how easily such a modification could be made. As time permits I will update the issue with the appropriate patch.

Has anyone else missed this option from the datetime implementation?

Update: Yes, while it is possible of course to manage such an implementation through the template language with some messy logic tests it is just against my principles. It should be handled by the underlying system and passed back already formatted.

Managing eZ Publish Web Content Management Projects

 

New Book from Packt Publishing

New Book from Packt Publishing

I was recently approached by Divya from Packt Publishing to review a new book recently authored by Martin Bauer of DesignIT, a local eZ Publish partner in Australia. The book is entitled, Managing eZ Publish Web Content Management Projects.

 

I certainly look forward to reviewing this book over the coming weeks and believe, based on the information I have already received, that it should contain a wealth of information we should all be applying to our larger eZ Publish projects.

For those interested you can read more and order the book online at Packt Publishing.