• All Elements
Packages
  • [Backend]
  • [Implementation]
  • [Implementation]-[Backend]
  • [Plugins]
[Implementation]


  • Package Elements
  • Class Hierarchy

Quick Menu
  • Description

feindura - Docs

  • Back to feindura.org
  • Startpage
  • Feindura Class
Welcome
Documentation
CHANGELOG | LICENSE

example


Show Example
  1. <?php
  2. /*                               *** SIMPLE EXAMPLE *** 
  3. -------------------------------------------------------------------------------- */
  4.  
  5. // add before any HTML Tag. (eg. before the <!doctype html>)
  6. require('cms/feindura.include.php');
  7.  
  8. // creates a new Feindura instance
  9. $feindura = new Feindura();
  10.  
  11. ?>
  12. <!DOCTYPE html>
  13. <html>
  14. ...
  15.  
  16. <?php
  17.  
  18. // create a menu from the category with ID "1"
  19. $menu = $feindura->createMenu('category',1,'ul.myNav');
  20.  
  21. // displays the menu
  22. foreach($menu as $item) {
  23.   echo $item['menuItem'];
  24. }
  25.  
  26.                                *** RESULT *** 
  27. --------------------------------------------------------------------------------
  28.  
  29. <ul class="myNav">
  30.   <li><a href="?category=1&amp;page=1" title="Example Page 1">Example Page 1</a></li>
  31.   <li><a href="?category=1&amp;page=2" title="Example Page 2">Example Page 2</a></li>
  32. </ul>
  33.  
  34.  
  35. /*                               *** EXTENDED EXAMPLE *** 
  36. --------------------------------------------------------------------------------
  37. This example uses all possible properties.
  38. It's also works much more simple: just call createMenu('category',1)
  39. and you have a simple array with links of the pages from this category.
  40. */
  41.  
  42. // add before any HTML Tag. (eg. before the <!doctype html>)
  43. require('cms/feindura.include.php');
  44.  
  45. // creates a new Feindura instance
  46. $feindura = new Feindura();
  47.  
  48. ?>
  49. <!DOCTYPE html>
  50. <html>
  51. ...
  52.  
  53. <?php
  54.  
  55. // set menu properties
  56. $feindura->menuShowAllPages           = true; // will overwrite the pages "show in menu" setting
  57. $feindura->menuId                     = 'menuId';
  58. $feindura->menuClass                  = 'menuClass';
  59. $feindura->menuAttributes             = 'test="menuAttribute1" onclick="menuAttribute2"';
  60.  
  61. // set link properties
  62. $feindura->linkLength                 = 20; // shortens the page title in the link
  63. $feindura->linkId                     = false; // set no id otherwise it will be repeated
  64. $feindura->linkClass                  = 'linkClass';
  65. $feindura->linkAttributes             = 'test="linkAttribute1" onclick="linkAttribute2"';
  66. $feindura->linkBefore                 = 'text before link ';
  67. $feindura->linkAfter                  = ' text after link';
  68. $feindura->linkBeforeText             = 'text before ';
  69. $feindura->linkAfterText              = ' text after';
  70. $feindura->linkShowThumbnail          = true;
  71. $feindura->linkShowThumbnailAfterText = false;
  72. $feindura->linkShowPageDate           = true;
  73. $feindura->linkPageDateSeparator      = ' - ';
  74. $feindura->linkShowCategory           = true;
  75. $feindura->linkCategorySeparator      = ' -> ';
  76.  
  77. // set thumbnail properties
  78. $feindura->thumbnailAlign             = 'left';
  79. $feindura->thumbnailId                = false; // set no id otherwise it will be repeated
  80. $feindura->thumbnailClass             = 'thumbnailClass';
  81. $feindura->thumbnailAttributes        = 'test="thumbnailAttribute1" onclick="thumbnailAttribute2"';
  82. $feindura->thumbnailBefore            = 'text before thumbnail ';
  83. $feindura->thumbnailAfter             = ' text after thumbnail';
  84.  
  85. // finally create the menu from the category with ID "1" using the above set properties
  86. $menu = $feindura->createMenu('category',1,'table',true,2);
  87.  
  88. // displays the menu
  89. foreach($menu as $item) {
  90.   echo $item['menuItem'];
  91. }
  92.  
  93.  
  94.  
  95.                                *** RESULT *** 
  96. --------------------------------------------------------------------------------
  97.  
  98. <table id="menuId" class="menuClass" test="menuAttribute1" onclick="menuAttribute2">
  99.   <tbody>
  100.     <tr><td>
  101.       text before link <a href="?category=1&amp;page=1" title="Example Category -> 2010-12-31 - Example Page 1"
  102.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  103.       text before thumbnail
  104.       <img src="/path/thumb_page1.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 1"
  105.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  106.       text after thumbnail
  107.       text before Example Category -> 2010-12-31 - Example ... text after
  108.       </a> text after link
  109.     </td><td>
  110.       text before link <a href="?category=1&amp;page=2" title="Example Category -> 2010-11-25 - Example Page 2"
  111.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  112.       text before thumbnail
  113.       <img src="/path/thumb_page2.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 2"
  114.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  115.       text after thumbnail
  116.       text before Example Category -> 2010-11-25 - Example ... text after
  117.       </a> text after link
  118.     </td>
  119.     </tr><tr>
  120.     <td>
  121.       text before link <a href="?category=1&amp;page=3" title="Example Category -> 2010-10-15 - Example Page 3"
  122.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  123.       text before thumbnail
  124.       <img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 3"
  125.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  126.       text after thumbnail
  127.       text before Example Category -> 2010-10-15 - Example ... text after
  128.       </a> text after link
  129.     </td><td>
  130.       text before link <a href="?category=1&amp;page=4" title="Example Category -> 2010-09-05 - Example Page 4"
  131.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  132.       text before thumbnail
  133.       <img src="/path/thumb_page4.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 4"
  134.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  135.       text after thumbnail
  136.       text before Example Category -> 2010-09-05 - Example ... text after
  137.       </a> text after link
  138.     </td></tr>
  139.   </tbody>
  140. </table>
  141.  
  142. ?>


The feindura API reference was generated from the comments in the feindura source code on Sat, 01 Dec 2012 21:55:22 +0000 by phpDocumentor 1.4.3
feindura - Flat File Content Management System, Copyright © Fabian Vogelsteller [frozeman.de]