BEdita package contains a folder named frontends. This is where you will find some frontend samples, we'll start from here.

In this article we are going to use a debug frontend (frontends/ to better understand some basic conepts. As you may already know, there are two other frontends available:, a simple web site based on Twenty Ten Wordpress, a dummy/empty publication and a dummy HTML 5 frontend.

Suppose that frontends/ is reachable at

Write it in the browser address bar and you could see a page with the language in use, current section, publication and configuration details, template data available and sections tree.
This root page is defined in config/routes.php that lead to FrontendController::route() method to load the first section of the publication related to frontend through $config['frontendAreaId'] variable you can find in config/frontend.ini.php file.
If it doesn't work check your webroot/index.php and config/bedita.sys.php, or use bedita shell script ( bedita checkApp) to check your settings.

By default Smarty is BEdita's default template engine but you can use CakePHP's View class simply setting in beditaBeforeFilter method of controllers/pages_controller.php

$this->view = 'View';

and using .ctp file extension instead of .tpl. In frontends/ you will find the views/templates. You can play with this frontend and learn how frontends in BEdita work simply by using it.

Nickname and id

In the following paragraphs and examples we will make heavy use of nicknames. A nickname is a unique alphanumeric semantic name for every BEdita object of an instance: you will find it in the Advanced Properties block of every object detail in backend (sections, documents, news, images,....). Let's use that nickname or the object id from now on.

So, for a specific section you've created digit

using a real nickname instead of section-nickname. Now you are on this section page, and you will see how content/section details are changed.

The page you see refers to views/pages/generic_section.tpl view, but if you create a template named views/pages/section-nickname.tpl then this will be used.

In this way every section is highly customizable and you can be able to create a different template for each section of your site.

Here's a url list on how to reach the same section:

And so on... the same using numeric id's instead of nicknames.

$section array

Let's see the main features of $section array that you will have available in the view when you make a call like above. Have a look at "current section: $section" paragraph and click on show/hide.

You will see the array dump that contains section data like "title", "description", etc...

Array (
  ['id'] => 2
  ['syndicate'] => 'on'
  ['priority_order'] => 'asc'
  ['object_type_id'] => 3
  ['status'] => 'on'
  ['created'] => '2008-04-23 08:29:46'
  ['modified'] => '2008-04-23 08:29:46'
  ['title'] => 'section title'
  ['nickname'] => 'section-nickname'
  ['description'] =>
  ['current'] => 1
  ['lang'] => 'ita'
  ['ip_created'] => ''
  ['user_created'] => 1
  ['user_modified'] => 1
  ['rights'] =>
  ['license'] =>
  ['creator'] =>
  ['publisher'] =>
  ['note'] =>
  ['fixed'] => 0
  ['comments'] => 'off'

besides these you'll find


array containing all the available translations.

['languages'] => Array (
  ['eng'] => Array ( 
     ['title'] => //section title 
  ['deu'] => Array(...),


array that contains the sections parents. It's build using sections id as array keys and ordered by depth: the first element will be the more distant ancient and the last element the parent.


canonical section path in the form /main-section/sub-section/sub-subsection...


array containing sections children


array containing all objects, sections excluded

These last arrays could be divided by object type


array containing the current content of a section. With

currentContent contains the object with nickname as content-nickname. With

currentContent contains the first child of section with nickname as section-nickname


array of pagination data:

['toolbar'] => Array (
   ['first'] => 0,
   ['prev'] => 0,
   ['next'] => 0,
   ['last'] => 0,
   ['size'] => 2,
   ['pages'] => 1,
   ['page'] => 1,
   ['dim'] => 100000,
   ['start'] => 1,
   ['end'] => 2


Get a specific object

So far we have seen how to get section data, but how can I get another object? Nothing could be easier:

BEdita will understand if the object is a section or a content and if it's a content will search the first section that contains it and load the $section array like we saw above. Moreover in the currentContent array will be placed the searched object and will be setted to true the $section["contentRequested"] variable.
If an object is present in more than one section then you just specify the section in the URL

What's inside an object?

The array structure of all objects is similar to $section with regard to general data and object languages. It will have some specific data like GeoTag, Category, Tag, etc... and


this array contains semantic relations between objects, some of these are already defined, but you could build your specific relations. The array structure is:

['relations'] => Array (
   ['attach'] => array( [0] => object1, [1] => object2, ...)
   ['seealso'] => array( [0] => object1,[1] => object2, ...)
   ['place'] => array( [0] => object1, [1] => object2, ...)
) ;


What else?

To finish this first frontend overview we see how to do REST calls to obtain the same $section array but in XML or JSON format.


Write in address bar:

or if you prefer having data in XML tags format


Likewise it's simple to obtain a JSON object, for example to use in an Ajax call.