NavBar: what to call it with

2005-07-26
2013-04-17
  • Henk Boerboom

    Henk Boerboom - 2005-07-26

    This is part of my index.php:
    ---
    print("<html><head><title>".$ewiki_title."</title>");
    print("<link rel='stylesheet' href='./fragments/css/WikiNavBarStyle.css' type='text/css' media='all' />");
    print("</head><body>".mkLiveWebNavBar('navBarPage','FrontPage').ewiki_page()."</body></html>");
    ---
    I made a page called navBarPage and put 2 wikiwords in it.
    *navbar.php* I dont understand what to put in $activePage ? The following sentence is not clear to me:
    .. and a page to be // selected, ...

     
    • Andy Fundinger

      Andy Fundinger - 2005-07-26

      The selected page is the one that will be highlit (or however your style marks it) usually this is simply $ewiki_id.  You can see my site as at http://andy.fundinger.name/ as an example or my company's site at http://www.burgiss.com as a more complex implementation. 

      Andy.Fundinger.name uses an override in the template file to select all buttons rather than just the default parents, siblings, uncles, and children:
      $ewiki_plugins['select_navbar_buttons'][]="ewiki_navbar_selectall_buttons";

      and an inclusion:

      <?php
        echo(mkLiveWebNavBar("AndySiteMap",$ewiki_id));
      ?>

      for it's effect.

      med.fundinger.info uses the fixed top renderer:

      $ewiki_plugins['render_navbar_section'][]='ewiki_render_navbar_fixedtop_list';

      and nearly the same generating line:

      <?php
      echo(mkLiveWebNavBar("SiteIndex",$ewiki_id))
      ?>

      to make it's navbar from the same database as the andy.fundinger.name site.

      Hope this helps, and I'd really welcome any alternate select and render routines you might create, there's lots of possibilities there.

      -Andy

       
    • Henk Boerboom

      Henk Boerboom - 2005-07-27

      I still don't get it, this is what I have now.
      $ewiki_plugins['select_navbar_buttons'][]="ewiki_navbar_selectall_buttons";
      include_once("ewiki.php");
      print("<html><head><title>".$ewiki_title."</title>");
      print("<link rel='stylesheet' href='./fragments/css/WikiNavBarStyle.css' type='text/css' media='all' />");
      print("</head><body>".mkLiveWebNavBar('navBarPage',$ewiki_id).ewiki_page()."</body></html>");

      {Detail: when you don't use *'s in your navBarPage then you don;t even het a page at all.}

      From the rendered html of your RambleSite is see that the navbar is rendered after the first H1, so it must come from within ewiki_page(). So I think that  ['select_navbar_buttons'] is a plugin-hook but then it would be a hook in a plugin ... and then I am lost ...

      My total index.php is here
      http://tst.bobromeo.nl/ewiki_db/?id=PageSource

      Maybe you can provide me w/ a some php-lines so I can understand how this is supposed to work.

       
    • Andy Fundinger

      Andy Fundinger - 2005-07-27

      Hmm, well, part of the problem is that the referenced $ewiki_id is set within the ewiki_page() call so you're getting a blank selected page.  I thought selectall would cover that though.  Still, why don't you try buffering the page as suggested in ewiki.php and a lot of our samples:

      $page_content=ewiki_page();

      (later)

      <?php
        echo($page_content);
      ?>

       
    • Henk Boerboom

      Henk Boerboom - 2005-07-27

      It works !! {Nice burgiss-site btw, who needs a CMS ?}
      The only thing I had to do is move the $ewiki_plugins-line up, and of course before the inc. of navbar.php ! (like in your example).

      See the result on
      http://tst.bobromeo.nl/ewiki_db
      Still trying and testing a lot of things.

      Q: I  am still not buffering, this to me only makes sense when you want to change the page that is to be displayed or when you want to changes the data of the wiki, but want to display the data before the change ?!?

       
      • Andy Fundinger

        Andy Fundinger - 2005-07-27

        The Burgiss site is really quite nice, the same design flows into our Intranet too.  Credit for the design on the Burgiss Site should go to Lance Wyman (http://www.lancewyman.com/) though I do get credit for the implementation.

        Yeah, with the plugin line below the include you wind up with the default selector--which selects none when there is no active page.

        Buffering is important and even necessary when you want to make parts of your template page dependant such as the mini calendar that we put in a lot of our examples (including andy.fundinger.name).  Normally you might want this on the navbar so that you can mark the current page (simply or with the more complex burgiss.com style) that is what the $activePage parameter to mklivewebnavbar() is for.  As I mentioned, the way you're doing it without the buffer means that you are effectively passing "" as this parameter and thus cannot get the selected page marking. 

        There is another use of buffering too, some of the plugins set cookies or send redirect headers and that cannot be done if output is started before they are called--within the ewiki_page() call.  You'll probably notice that eventually, but you may not have any interest in those features.

        -Andy

         
    • Henk Boerboom

      Henk Boerboom - 2005-07-27

      I'll start a buffer test now. because the only that worked was: ewiki_navbar_selectall_buttons.

       
    • Henk Boerboom

      Henk Boerboom - 2005-07-27

      It seems to work. Even changed a bit of css, block := inline.
      But why is it gone, when i click on a WW that is not in the navBar ?

      zzzzzzzzzzzz...

       
      • Andy Fundinger

        Andy Fundinger - 2005-07-28

        The answer is simple, the psuc selector  does just as it says, selecting the parents, siblings, uncles, and children of the selected $activePage.  As you've noticted, when you are off the NavBar that is an empty set. 

        When this bothers you, and I can understand that it might, the best solution is to write a custom selector. That's what I've done for burgiss.com, but I can't release that code. I can, however, tell you that it is a fairly simple combination of the two that I did release, and an even simpler combination could be written to good effect, but I haven't done that just yet.  I'd take a submission for it :-)

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks