SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Navigation puzzle?! 2 bits of useful code?

    Hi,

    I have found some code at a web site: Parrot Speakers

    The 2 separate bits of code are below. In terms of selecting which navigation bar to display on the left-hand side, this concept looks easy but I do not know how it is done. Any ideas? If you view a different product, then the left hand navigation changes!

    In the first bit of code the "option value=" is something I've never seen before. And in the second bit of code below the "<div id='related_categories_section'>" also looks useful but I do not understand it.

    Can anyone briefly explain the concept for this navigation bar that changes relative to viewed content. Is it PHP or something else?

    Look forward to your insights,

    Matt.
    CODE IS BELOW


    <h1 class="mfpagetitle" style="margin: 8px 0px 5px 0px;">Parrot Speakers</h1>
    <form action='' method='post'>
    <select id="category-dropdown" name="category-dropdown">
    <option value="1">Browse Other Parrot</option>
    <option value="/cat/Parrot-Fitted-Car-Kits.htm"> - Parrot Fitted Car Kits</option>
    <option value="/cat/Parrot-Novelty-and-Fun.htm"> - Parrot Novelty and Fun</option>
    <option value="/cat/Parrot-Photo-Frames.htm"> - Parrot Photo Frames</option>
    <option value="/cat/Parrot-Plug-and-Play-Car-Kits.htm"> - Parrot Plug and Play Car Kits</option>
    <option value="/cat/Parrot-Speakers.htm"> - Parrot Speakers</option>
    </select>
    <noscript><input type="submit" value="Go" /></noscript>
    </form>






    </div>

    <br />



    AND THE SECOND BIT OF CODING IS


    <div class="seo_links_subcategory_siblings">
    <span class="tab"><h2>Related Accessories</h2><div class="tab-tr"></div><div class="tab-tl"></div></span>
    <div style="border-top: 1px solid #d0d0d0; padding: 10px 5px; clear: both">

    <div id='related_categories_section'>
    <ul style="width: 50%; float: left">

    <li>
    <a href="/cat/Parrot-Fitted-Car-Kits.htm" title="Parrot Fitted Car Kits">Parrot Fitted Car Kits</a>
    </li>


    <li>
    <a href="/cat/Parrot-Novelty-and-Fun.htm" title="Parrot Novelty and Fun">Parrot Novelty and Fun</a>
    </li>


    <li>
    <a href="/cat/Parrot-Photo-Frames.htm" title="Parrot Photo Frames">Parrot Photo Frames</a>
    </li>

    </ul>

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    <option> tags are standard HTML form tags contained within a <select> tag to define options in a dropdown selection box.

    From the looks of it, the form takes the user's input as a filename, and simply does <?php include_once($_POST['category-dropdown']; ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •