HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


There are no pages beneath this page

Submitted by Chris Graham
If you are making a new module with tree-based categories, and want to show breadcrumbs…

Let's say you have a front page to the module, and you have something in a category with a parent category "Bar" and that has a parent category "Foo" and that has a parent category "Root".

This would create: Module index > Root > Foo > Bar

PHP code

'_SELF:_SELF:misc','Module index'), // type=misc
array('_SELF:_SELF:category:1','Root'), // type=category&id=1
array('_SELF:_SELF:category:3','Foo'), // type=category&id=3
array('_SELF:_SELF:category:6','Bar'), // type=category&id=6

_SELF:_SELF means "current zone, current page". It stops you having to hard-code zone and page names.

ocPortal automatically puts stuff in front, and puts the title of the current page on the end (as a non-link), so it would show something like: Home > Module index > Root > Foo > Bar > Something

Of course, in real code you are more likely to put this together in a loop, so your code will be more like:

PHP code

// Recursively find parents and put each as a breadcrumb
    if (
while (
$breadcrumbs[]=array('_SELF:_SELF:misc','Module index');

The above code is just illustrative. The find_parent function is not real, nor is $category_id – substitute as appropriate for whatever you write/use yourself.

If the title of the current page is too long or looks weird in the breadcrumbs, you can override it

PHP code


CEDI change-log Post