Jan Kudlicka

Contact Jan Kudlicka

Jan had been working as an independent consultant for many years, specializing in web application development, before he joined eZ Systems in 2004 where he worked together with both the core and project team. As a part of his job he also concentrated on performance boosting on large projects implemented with eZ Publish. In 2007 he joined Seeds Consulting AS.

Home > eZ Publish > eZ Publish Tips And Tricks > Helper Child Nodes: User-Friendly Search...

Did you know that we offer expert eZ Publish services to eZ Publish partners with 10% discount?

09 Apr 08

Jan Kudlicka

Helper Child Nodes: User-Friendly Search Results and Preventing Full Node Views

Here, we will take a look at several scenarios of common structures involving helper nodes.

Forums

If you have a forum in eZ Publish, you probably use classes for forums, forum threads and forum replies. A forum has forum threads as children and a forum thread has forum replies as children. The full view of a forum shows a list of threads under it and the full view of every thread shows all or some of its children.

However, you do not want to show the full view of a forum reply. More importantly, you do not want to show multiple replies within the same thread if you search for a term that frequently occurs in a few replies (for example, when these replies quote the same text).

Similar examples include article comments, glossaries, and lists of simple entries like basic information about employees, web addresses, and so on.

These examples have the following in common:

  • The full view of children must not be shown.
  • Search hits must return the master, parent node.

Arrays of content

In eZ Publish, if you need content that is an array of strings, integers or other simple types and you do not need the validation, you can use the Matrix datatype and override the edit template for the attribute. However, if you need validation or you need to use other types such as images, XML text blocks or files, you need to use helper nodes.

Consider an information portal for a tax office. Your customer wants to be able to attach an arbitrary number of electronic forms in PDF format to pages about tax requirements. The process also needs to be simple to remove, replace or add forms at any time without editing the specific tax requirements page. You will probably have a class with an XML text block for the tax requirements pages and a class for the PDF forms.

Download links are directly available in the full view of the requirements pages. Regarding the forms themselves, the customer may or may not want to show the full views. It might be unnecessary and undesirable, or the customer might want to show some metadata about the PDF documents, such as keywords, the document author, instructions on how to fill in the form, and so on. Either way, for search hits, you probably want to return the requirements pages only (so that users see the forms in the context of the related requirements).

To summarize:

  • The full view of children may or may not be shown.
  • Search hits must return the master, parent node.

Galleries

An image gallery is a typical example where the full view of the children is necessary (showing an image in full scale, together with links to the previous and next images). However you might want to give users the choice to return search results for individual images or for the galleries containing the image results.

In other words:

  • The full view of children must be shown.
  • Search hits may or may not return child nodes.

In all of these scenarios, note that it is important to use unique classes for helper nodes. If you were to use the same classes for both helper nodes and other, unrelated nodes, this makes it much more difficult to override the full, line, and other views for the helper nodes and to prevent them from appearing as search hits.

Comments

To add a comment, fill in and submit the form below.

Add a comment

Are you interested in our services? Let us know what we can do for you...