Navigation module

This chapter describes

1 Introduction

Navigation module allows to show topnavigation, subnavigation, breadcrumb and sitemap.

Navigation widget can be added to all content objects (except binary files). Depending on given settings it can show sitemap or navigation inside given folder (subnavigation) or top level navigation (topnavigation) or breadcrumb.

2 Structure

Navigation module is placed in folder <portal>/common/modules/navigation. It depends on personalisation module.

Structure is the same as for other modules.

There is 1 widget:

  • NavigationWidget – show sitemap or navigation inside given folder (subnavigation) or top level navigation (topnavigation) or breadcrumb.

Invokes:


<?php $this->widget('navigation.widgets.NavigationWidget', array('startfolderId'=>unique_content_id)); ?>

In this case unique_content_id is a folder ID (of the CMS) that should be considered as root folder for current widget call.

Parameters:

  • startfolderId (string) – ID of the folder that should be considered as root. Required;
  • activeElement (string)- defines current active element. Required if isSitemap=false;
  • isSitemap (bool) – is this parameter is set to true, then all branches will get class=”opened”;
  • isBreadcrumb (bool) – defines if this widget is in breadcrumb mode. If it is – then only elements from active path will be shown;
  • cssClass (string) – if this parameter is set, then it will be added to all
      tags a CSS class. Default value is “navigation”;
    • maxLvl (integer) – if this parameter is set and it is more than zero, then category tree depth will be limited by it;
    • hideFirstLevel (bool) – if this parameter set to true, first level of folders will be skipped. For example, if ‘startfolderId’=>’10002.580’ and ‘hideFirstLevel’=>true then the system will not show children of 10002.580;
    • usePersonalisation (bool) – default is true. Defines if result should be personalised or not.
    • extraRequestFields (string) – comma separated extra request fields

    4 Examples

    • Topnavigation:
    
        <?php
            $this->widget(
                'navigation.widgets.NavigationWidget',
                array(
                    'startfolderId'=>'10002.580',
                    'maxLvl'=>4, //or any other number greater than 1
                    'isSitemap'=>true //important
            );
        ?>
    
    • Subnavigation:
    
        <?php
            $this->widget(
                'navigation.widgets.NavigationWidget',
                array(
                    'startfolderId'=>'10002.580',
                    'cssClass'=>'nav',
                    'hideFirstLevel'=>true,
                    'activeElement'=>'10002.3216',  //current active element of navigation
                    'maxLvl'=>10
                )
            );
        ?>
    
    • Breadcrumb:
    
        <?php
            $this->widget(
                 'navigation.widgets.NavigationWidget',
                 array(
                    'startfolderId'=>'10002.580',
                    'activeElement'=>'10002.3216',
                    'cssClass'=>'breadcrumb',
                    'isBreadcrumb'=>true
                 )
             );
        ?>
    
    • Sitemap:
    
        <?php
            $this->widget(
                'navigation.widgets.NavigationWidget',
                array(
                    'startfolderId'=>'10002.580',
                    'isSitemap'=>true //important
            );
        ?>