eZ publish: Custom root node
Florence SONG | August 13, 2010One of many key features of eZ publish is flexibility. You can customize almost anything from content structure to output presentation. In this short tutorial I will show how to specify a custom default root node class.
By default, eZ publish uses a root node ID 2 in content structure (“Content structure” tab) tree based on the folder class, and in many cases that is sufficient. However, sometimes we want to use our own custom class as the site’s front page. A custom class allows us to build a complex front page that uses a different layout than the rest of the site. Rather than extending the default folder class with attributes that are only used on the front page, creating a custom class gives us the flexibility to build a custom front page without impacting the rest of the site.
First we need to create new content class. You can define your new content class in the Administration Interface. Click the Setup tab, then select the Classes option from the left menu. I will not describe this process as it is very well explained in the eZ publish technical manual.
Note that your custom class must be marked as a ?container? in order to display content from within the content structure tree.
Once the content class is ready to use, create a new content object as an instance of your new class somewhere under the root node. Now we can swap the eZ publish root node with the newly created object. Click the left mouse button on the folder icon beside the root node folder name and select “Advanced->Swap with another node” from the context menu.
In browse mode choose the newly created object and click the “Select” button.
Done. Now you can edit your root node and populate the attributes of your custom class with content.
Next we need to configure the content structure tree.
Edit the file “settings/siteaccess/(your_admin_siteaccess)/contentstructuremenu.ini.append.php” and add your class to the list. Your configuration file should contain the following data:
[TreeMenu]
ShowClasses[]
ShowClasses[]=folder
ShowClasses[]=user_group
ShowClasses[]=custom_class
*/ ?>
Save your settings and clear the cache. After the page reloads, you should see your custom front page in the content structure, similar to the picture below:
Now you can assign a template to your custom class or make a node override for node ID 2 and make nice front page for your site.









Hello mans did you have old archives ? I deal article build up pro me … ..
very good \o/
Yay google is my world beater assisted me to find this great website ! .
Love your site and all your tips.
Yet another thing I would like to convey is that rather than trying to match all your online degree training on days and nights that you complete work (since the majority people are worn out when they come home), try to obtain most of your instructional classes on the saturdays and sundays and only one or two courses on weekdays, even if it means taking some time off your saturday and sunday. This is beneficial because on the saturdays and sundays, you will be extra rested as well as concentrated in school work. Thanks alot : ) for the different tips I have discovered from your site.
I have really learned some new things by means of your blog site. One other thing I’d prefer to say is that newer laptop operating systems tend to allow more memory to get used, but they in addition demand more memory space simply to function. If a person’s computer can’t handle a lot more memory and also the newest application requires that storage increase, it might be the time to shop for a new Computer system. Thanks
I just enjoy following these stories. It truly makes my day.
Original article here: http://serwatka.net/blog/ez_publish_custom_root_node – I’m sure you’ve only forgotten to mention the original author, haven’t you, Florence
.
Hello,Your site is very interesting site. I will come back to visit again and I Tweet this page to a friend of mine already.
Hello there, you have here a quite good webpage at present! I enjoy a lot a finely updated post.
I believe you have observed some very interesting points, regards for the post.