forked from darwin26/navigation_factory
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
RexDude
committed
Nov 14, 2015
1 parent
ed0f830
commit d4f5b5f
Showing
15 changed files
with
124 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Codebeispiele | ||
============= | ||
|
||
Ausgabe des 1. Navigationslevels | ||
-------------------------------- | ||
|
||
```php | ||
$nav = new rex_nav(); | ||
$nav->setLevelDepth(1); | ||
echo $nav->getNavigationByLevel(0); | ||
|
||
``` | ||
|
||
Ausgabe des 2. und 3. Navigationslevels | ||
--------------------------------------- | ||
|
||
```php | ||
$nav = new rex_nav(); | ||
$nav->setLevelDepth(3); | ||
echo $nav->getNavigationByLevel(1); | ||
``` | ||
|
||
Ausgabe der Navigation mit Startkategorie-Id = 42 | ||
------------------------------------------------- | ||
|
||
```php | ||
$nav = new rex_nav(); | ||
$nav->setLevelDepth(2); | ||
echo $nav->getNavigationByCategory(42); | ||
``` | ||
|
||
|
||
Alle Methoden und Paramater der rex_nav Klasse | ||
---------------------------------------------- | ||
|
||
```php | ||
$nav = new rex_nav(); | ||
|
||
$nav->setLevelDepth(2); // 2 level tief | ||
$nav->setShowAll(true); // alle unterebenen werden angezeigt | ||
$nav->setIgnoreOfflines(true); // offline artikel werden nicht angezeigt | ||
$nav->setHideWebsiteStartArticle(false); // startartikel der website wird nicht ausgeblendet | ||
$nav->setHideIds(array(42, 108)); // kategorien mit ids 42 und 108 werden ausgeblendet | ||
$nav->setSelectedClass("current"); // li klasse für selektierte menüpunkte: "current" | ||
$nav->setActiveClass("current active"); // li klasse für gerade aktiven menüpunkt: "current active" | ||
$nav->setUlId("nav", 0); // erste ul id: "nav" | ||
$nav->setUlClass("sf-menu", 0); // erste ul klasse "sf-menu" | ||
$nav->setLiClass("list-item"); // li klasse "list-item" | ||
$nav->setLiIdFromMetaField("cat_css_id"); // li id aus metainfo feld: "cat_css_id" | ||
$nav->setLiClassFromMetaField("cat_css_class"); // li klasse aus metainfo feld: "cat_css_class" | ||
$nav->setLiIdFromCategoryId(array(42 => "foo", 43 => "bar")); // li id anhand artikel id | ||
$nav->setLiClassFromCategoryId(array(42 => "my-class")); // li klasse anhand artikel id | ||
$nav->setCustomLink(function($cat, $depth) { // php funktion die den link zurückgibt (hier als beispiel: erste ebene ohne verlinkung) | ||
if ($depth == 1) { | ||
return htmlspecialchars($cat->getName()); | ||
} else { | ||
return '<a href="' . $cat->getUrl() . '">' . htmlspecialchars($cat->getName()) . '</a>'; | ||
} | ||
}); | ||
|
||
echo $nav->getNavigationByCategory(42); | ||
``` | ||
|
||
Ausgabe einer einfachen Sprachnavigation | ||
---------------------------------------- | ||
|
||
```php | ||
$nav = new rex_lang_nav(); | ||
|
||
$nav->setUlId("lang-nav"); // ul id: "lang-nav" | ||
$nav->setUlClass("my-lang-class"); // ul class: "my-lang-class" | ||
$nav->setselectedClass("current"); // li klasse für selektierten menüpunkt: "current" | ||
$nav->setshowLiIds(true); // zusätzliche, eindeutige li id's werden ausgegeben | ||
$nav->sethideLiIfOfflineArticle(false); // bei einem offline artikel li nicht verstecken sondern auf startartikel der website verlinken | ||
$nav->setuseLangCodeAsLinkText(true); // langcode anstelle sprachname als linktext ausgeben | ||
$nav->setupperCaseLinkText(true); // linktext in großbuchstaben anzeigen | ||
|
||
echo $nav->getNavigation(); | ||
``` | ||
|
||
Ausgabe einer Breadcrumb Navigation | ||
----------------------------------- | ||
|
||
```php | ||
$nav = new rex_breadcrumb_nav(); | ||
|
||
$nav->setCssClass("breadcrumb"); // ul klasse: "breadcrumb" | ||
$nav->setOlList(false); // es wird eine ul liste ausgegeben | ||
$nav->setStartArticleName("<i class='fa fa-home'></i>"); // ausgabe mit font-awesome icon | ||
|
||
echo $nav->getNavigation(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
|
||
echo rex_navigation_factory_utils::getHtmlFromMDFile('CODEEXAMPLES.md'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
$search = array('(CHANGELOG.md)', '(LICENSE.md)'); | ||
$replace = array('(index.php?page=navigation_factory&subpage=help&chapter=changelog)', '(index.php?page=navigation_factory&subpage=help&chapter=license)'); | ||
$search = array('(CHANGELOG.md)', '(LICENSE.md)', '(CODEEXAMPLES.md)'); | ||
$replace = array('(index.php?page=navigation_factory&subpage=help&chapter=changelog)', '(index.php?page=navigation_factory&subpage=help&chapter=license)', '(index.php?page=navigation_factory&subpage=help&chapter=codeexamples)'); | ||
|
||
echo rex_navigation_factory_utils::getHtmlFromMDFile('README.md', $search, $replace); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.