hi all,

i'm new to cakephp. i've read through most of the manual and have
completed the blog tutorial. i've got a decent feel for the basic
idea, but i'm confused about the best way to implement a menu. i'd
like to have the same menu on each page. i've coded the menu, and
could put it into the template, but i'm not sure how to set the
'current' item in the menu. any help is appreciated...thanks.

here is the html and css for a test menu i found. how can i include
this menu in my template, but dynamically set the (class="sel") for
the current item.

html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">

<html>
<head>
        <title></title>
        <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<div id="leftbar">
<div id="navig">

<h2>Navigation</h2>

<ul>
  <li><a href="intro.html"><span class="name">Introduction</span></a></
li>
  <li><a href="hosting.html"><span class="name">Hosting</span></a></
li>
  <li><a href="htaccess.html"><span class="name">.htaccess files</
span></a></li>
  <li><a href="xhtml.html"><span class="name">XHTML &amp; CSS2</span></
a></li>
  <li class="sel"><a href="cssimg.html"><span class="name">CSS and
Images</span></a></li>
  <li><a href="perlphp.html"><span class="name">Perl and PHP</span></
a></li>
  <li><a href="xml.html"><span class="name">XML &amp; XSLT</span></a></
li>
  <li><a href="http.html"><span class="name">HTTP headers</span></a></
li>
  <li><a href="mysql.html"><span class="name">MySQL</span></a></li>
  <li><a href="javascript.html"><span class="name">JavaScript</span></
a></li>
  <li><a href="security.html"><span class="name">Security</span></a></
li></ul>
<ul>
<li><a href="/mail.php"><span class="name">Contact Me</span></a></li>
<li><a href="/"><span class="name">Homepage</span></a></li>
</ul>

</div> <!-- navig -->
</div>
</body>
</html>



css:

#leftbar {
    width: 25%;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    z-index: 0;
}

#navig {
    display: block;
    padding: 0;
    margin: 0;
}

#navig ul {
    margin: 0 0 2ex 0;
    width: 90%;
    padding: 0;
}

#navig li {
    display: block;
    width: 100%;
    list-style-type: none;
    list-style-position: outside;
    padding: 0;
    margin: 0;
}

#navig li.sel {
    display: block;
    background: #009900;
    color: inherit;
}

#navig a {
    display: block;
    background: #66cc00;
    border-left: solid #66cc00 3px;
    border-right: solid #66cc00 3px;
    border-top: 0;
    border-bottom: 0;
    color: black;
    text-decoration: none;
    font-family: sans-serif;
    width: 100%;
    padding: 2px 0 3px 0;
    font-weight: bold;
    font-size: 90%;
    margin: 1px 0 0 0;
}

#navig a:hover {
    border-left: solid #009900 3px;
    border-right: solid #009900 3px;
}

#navig li.sel a {
    display: block;
    background: #009900;
    border-left: solid #009900 3px;
    border-right: solid #009900 3px;
    color: #ccff66;
}

#navig .name { padding: 0 6px; }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to