* @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org * * {@internal * created 2008-02-19 * * $Id$: * }} * */ if(!defined('CON_FRAMEWORK')) { die('Illegal call'); } // ##################################################################################################################### // ########### standard navigation // ########### retrieve subcategories of a given category and output them with idcat and name // ##################################################################################################################### try { $oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient); $oContenidoCategories = $oFeNav->getSubCategories($idcat, true); // use some valid idcat of "home" or whatever //$oContenidoCategories = $oFeNav->getSubCategories($idcat, true, true, 2); // for loading subcategories up to level 2 if ($oContenidoCategories->count() > 0) { foreach ($oContenidoCategories as $oContenidoCategory) { // output idcat and name of cat echo '
'.$oContenidoCategory->getIdCat().' | '.$oContenidoCategory->getCategoryLanguage()->getName().'
'; } } } catch (InvalidArgumentException $eI) { echo 'Some error occured: ' . $eI->getMessage() . ': ' . $eI->getFile() . ' at line '.$eI->getLine() . ' ('.$eI->getTraceAsString().')'; } catch (Exception $e) { echo 'Some error occured: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')'; } // ##################################################################################################################### // ########### breadcrumb navigation // ########### retrieve breadcrumb from a given category up to a given level and output the categories with idcat and name // ##################################################################################################################### try { $oBreadcrumb = new Contenido_FrontendNavigation_Breadcrumb($db, $cfg, $client, $lang, $cfgClient); $oBreadCategories = $oBreadcrumb->get($idcat); foreach ($oBreadCategories as $oBreadCategory) { echo 'Bread '.$oBreadCategory->getIdCat().', '.$oBreadCategory->getCategoryLanguage()->getName().'
'; } } catch (InvalidArgumentException $eI) { echo 'Some error occured: ' . $eI->getMessage() . ': ' . $eI->getFile() . ' at line '.$eI->getLine() . ' ('.$eI->getTraceAsString().')'; } catch (Exception $e) { echo 'Some error occured: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')'; } // ##################################################################################################################### // ########### standard navigation with some funky URLs // ########### retrieve subcategories of a given category and output them linked with different styles: // ########### front_content.php?idcat=1 // ########### index-a-1.html // ########### cat1/cat2/index-a-1.html // ########### http://www.someurl.com/index-b-13-91.html // ########### /path/path/path/rocknroll,goodies,1,2,3.4fb // ##################################################################################################################### // build Navigation with different types of URL style $aUrlStyleFunky = array('prefix' => 'rocknroll', 'suffix' => '.4fb', 'separator' => ','); // to create some other style of url try { $oFeNav = new Contenido_FrontendNavigation($db, $cfg, $client, $lang, $cfgClient); $oContenidoCategories = $oFeNav->getSubCategories(12, true); // use some valid idcat of "home" or whatever if ($oContenidoCategories->count() > 0) { foreach ($oContenidoCategories as $oContenidoCategory) { // get needed data $iIdcat = $oContenidoCategory->getIdCat(); $iParentIdcat = $oContenidoCategory->getIdParent(); $sCatName = $oContenidoCategory->getCategoryLanguage()->getName(); // -> front_content.php?idcat=1 $sUrl1 = 'click1'; // -> index-a-1.html $sUrl2 = 'click2'; // -> cat1/cat2/index-a-1.html $sUrl3 = 'click3'; // -> http://someurl.com/path0/path1/index-b-13-91.html $sUrl4 = 'click4'; // -> /cat0/cat1/cat1/rocknroll,members,1,2,3.4fb (where "cat" being languagedependent) $sUrl5 = 'click5'; echo 'idcat: '.$iIdcat.' | '. 'parent idcat: ' . $iParentIdcat.' | '. 'category name: ' . $sCatName.' | '. 'URL: '.$sUrl1.' - '.$sUrl2.' - '.$sUrl3.' - '.$sUrl4.' - '.$sUrl5.'
'; } } } catch (InvalidArgumentException $eI) { echo 'Some error occured: ' . $eI->getMessage() . ': ' . $eI->getFile() . ' at line '.$eI->getLine() . ' ('.$eI->getTraceAsString().')'; } catch (Exception $e) { echo 'Some error occured: ' . $e->getMessage() . ': ' . $e->getFile() . ' at line '.$e->getLine() . ' ('.$e->getTraceAsString().')'; } ?>