Dynamic menu bar in a frame - controlling frames in php?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martien van Wanrooij

    Dynamic menu bar in a frame - controlling frames in php?

    I have been using in a lot of websites a script that creates a menu bar but
    avoids that the button to the current page can be clicked.
    I am rather satisfied with it (although suggestions for better ways of doing
    things are welcome, the script follows below FYI)
    No there is a a problem that for a new site (www.orkestbasic.nl/nieuw) the
    menu with the links has to be placed in a separate frame because the right
    part of the page must be scrollable. So the check wether a button has to be
    a link or not cannot be done anymore with checking PHP_SELF as I am used to
    do.
    I am thinking of making all the links to something like <a href =
    "main.php?conte nt=songlist">
    then main.php would be a frameset with something like <frame name =
    "content" src = "<?php echo "$content.php"? >">
    In the left frame I could do a similar thing with a small modification to
    the createlink function (see below) I often use.
    But I would like to know if there are more elegant suggestions for it. Could
    not find really good tips on google. Thanks for any help


    FYI This is the function I have been using until now.


    function mvwMaakLink($om schrijving, $verwijzing, $separator = "",
    $aHrefClass = "", $noHrefClass = "")
    {
    $locatie = $_SERVER['PHP_SELF'];
    //link to the current page, no need for clicking on
    it
    //echo $locatie;
    if (strstr($locati e, $omschrijving))
    {
    $beginTag = "";
    $slotTag = "";
    if ($noHrefClass != "")
    {
    $beginTag = "<span class = \"$noHrefClass\ ">";
    $slotTag = "</span>";
    }
    echo "$beginTag$verw ijzing$slotTag" ;
    }
    else
    {
    $beginTag = "<a ";
    if ($aHrefClass != "")
    {
    $beginTag .= "class = \"$aHrefClas s\" ";
    }
    $beginTag .= "href = \"$omschrijving \">";
    echo("$beginTag $verwijzing</a>$separator") ;
    }
    }


  • Oli Filth

    #2
    Re: Dynamic menu bar in a frame - controlling frames in php?

    Martien van Wanrooij said the following on 05/09/2005 17:44:[color=blue]
    > I have been using in a lot of websites a script that creates a menu bar but
    > avoids that the button to the current page can be clicked.
    > I am rather satisfied with it (although suggestions for better ways of doing
    > things are welcome, the script follows below FYI)
    > No there is a a problem that for a new site (www.orkestbasic.nl/nieuw) the
    > menu with the links has to be placed in a separate frame because the right
    > part of the page must be scrollable. So the check wether a button has to be
    > a link or not cannot be done anymore with checking PHP_SELF as I am used to
    > do.
    > I am thinking of making all the links to something like <a href =
    > "main.php?conte nt=songlist">
    > then main.php would be a frameset with something like <frame name =
    > "content" src = "<?php echo "$content.php"? >">
    > In the left frame I could do a similar thing with a small modification to
    > the createlink function (see below) I often use.
    > But I would like to know if there are more elegant suggestions for it. Could
    > not find really good tips on google. Thanks for any help
    >[/color]

    As an alternative to frames, you could investigate scrollable DIVs.
    e.g.:


    CSS
    ===

    HTML { overflow: hidden; }

    #menu
    {
    position: absolute;
    width: 30%;
    height: 100%;
    top: 0;
    left: 0;
    background: #FF9999;
    }

    #pagecontent
    {
    position: absolute;
    width: 70%;
    height: 100%;
    top: 0;
    right: 0;
    background: #9999FF;
    overflow: scroll;
    }




    HTML
    ====


    <DIV id="menu">
    ... menu stuff here ...
    </DIV>

    <DIV id="pagecontent ">
    ... the page content here ...
    </DIV>



    This avoids the evils of frames, (Google for "frames are evil").


    --
    Oli

    Comment

    • Martien van Wanrooij

      #3
      Re: Dynamic menu bar in a frame - controlling frames in php?


      "Oli Filth" <catch@olifilth .co.uk> schreef in bericht
      news:U4%Se.3725 $7p1.1809@newsf e7-win.ntli.net...[color=blue]
      > As an alternative to frames, you could investigate scrollable DIVs.[/color]
      I know that this possibility and I often visit a Dutch ng to discuss such
      problems but I am afraid it will be very difficult to make it work in all
      browsers. Although this is offtopic for the php forum I would like that my
      customer would write shorter text to avoid the whole scrolling problem. :)
      Thanks for your advise anyway :)

      Martien


      Comment

      Working...