Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2014-08-13 09:57:17

kmcintyre
Member
From: TN, USA
Registered: 2012-10-02
Posts: 24
Website

Drop-down navigation question

http://ktmcreative.com/

I have another question concerning Pages.  I finally think I have a grasp of drop-down navigation.  I was able to enable the "autoindex" section of my phplugins file and got a second gallery page going (Projects) with its own autoindex.  It has a test gallery under that and all works as expected.  Coming from a coding n00b, I was tickled to get this far. 

I am attempting to do the same with the About Me page (renamed from default About Pages page) with the intention to put some text-based pages under there (a couple are there for examples).  The navigation bar is acting very strange for this About Me menu.  It's navigation is acting totally different from the Galleries and Projects at least for me in IE and Firefox.  I used the same snippet of code that I copied and pasted for the Projects page to build the About Me menu changing the necessary specifics. 

Not sure what else you might need.  Below is a copy/paste of the autoindex section of my phplugins file.

// SITE-WIDE "DROP-DOWN" NAVIGATION MENU w/ AUTO INDEX DROP-MENU
// This function establishes a site-wide navigation menu using pseudo-absolute URLs (beginning "/")
// -- portable, domain agnostic, and without the location limitations of relative URLs.
// Serves as an example of a function being applied globally.
// Utilizes the auto index script to list galleries in a specified location as a drop-menu.
function ttg_header_navigation( $style, $path ) {
    echo '
<div id="navigation-container" class="navigation-container clearfix">

    <div id="navigation" class="block-id navigation clearfix">
    <div class="mantle clearfix">
        <div class="core clearfix">
        <div id="navigation-background">

        <div id="r2d2-menu" class="clearfix">
        <ul id="pull">
            <li><span>&nbsp;</span></li>
            <li><span>&nbsp;</span></li>
            <li><span>&nbsp;</span></li>
            <li><span>&nbsp;</span></li>
            <li id="open-nav" class="toggle-nav"><a href="#r2d2-menu"><i class="fa fa-reorder"></i></a></li>
            <li id="close-nav" class="toggle-nav"><a href="#"><i class="fa fa-remove"></i></a></li>
        </ul>

        <ul id="nav">
        <!-- EDIT ONLY BELOW THIS LINE : -->

            <li><a href="/">Home</a></li>
            <li><a href="/galleries.php">Galleries</a>
                <ul>
';

    $theroot = $_SERVER['DOCUMENT_ROOT'];
    $indexPath = '/galleries/'; // set folder location to scan for galleries

    require_once($theroot.'/lib/autoindex/autoindex.php');
    if (trim($_SERVER["QUERY_STRING"]) == 'debug')
        define ('AUTOINDEX_DEBUG', true); // enable statement to output debugging info from autoindex()
    $albums = autoindex($theroot.$indexPath);
    // $albums = array_reverse($albums); // Reverses album order
    // shuffle($albums); // Shuffles albums
    $j = min(count($albums), 8); // build <li>s from first 8 in gallery list   
    for($i=0; $i < $j; $i++) {
        echo '<li><a href="'.$albums[$i]['url'].'" title="'.$albums[$i]['description'].'">'.$albums[$i]['title'].'</a></li>';
    };
    if (count($albums) > 8) { // the 8 here matches the 8 above
        echo '<li><a href="/galleries.php" title="See more galleries" >more ...</a></li>';
    };

    echo '
                </ul>
            </li>
            <li><a href="/projects/index.php">Projects</a>
                <ul>
';

    $theroot = $_SERVER['DOCUMENT_ROOT'];
    $indexPath = '/projects/'; // set folder location to scan for galleries

    require_once($theroot.'/lib/autoindex/autoindex.php');
    if (trim($_SERVER["QUERY_STRING"]) == 'debug')
        define ('AUTOINDEX_DEBUG', true); // enable statement to output debugging info from autoindex()
    $albums = autoindex($theroot.$indexPath);
    // $albums = array_reverse($albums); // Reverses album order
    // shuffle($albums); // Shuffles albums
    $j = min(count($albums), 8); // build <li>s from first 8 in gallery list   
    for($i=0; $i < $j; $i++) {
        echo '<li><a href="'.$albums[$i]['url'].'" title="'.$albums[$i]['description'].'">'.$albums[$i]['title'].'</a></li>';
    };
    if (count($albums) > 8) { // the 8 here matches the 8 above
        echo '<li><a href="/projects/index.php" title="See more galleries" >more ...</a></li>';
    };

    echo '
                </ul>
            </li>
                               
            <li><a href="/blog/">Blog</a></li>
            <li><a href="/services.php">Services</a></li>
            <li><a href="/info.php">Info</a></li>
                       
            </ul>
            </li>
            <li><a href="/projects/index.php">Projects</a>
                <ul>
';

    $theroot = $_SERVER['DOCUMENT_ROOT'];
    $indexPath = '/projects/'; // set folder location to scan for galleries

    require_once($theroot.'/lib/autoindex/autoindex.php');
    if (trim($_SERVER["QUERY_STRING"]) == 'debug')
        define ('AUTOINDEX_DEBUG', true); // enable statement to output debugging info from autoindex()
    $albums = autoindex($theroot.$indexPath);
    // $albums = array_reverse($albums); // Reverses album order
    // shuffle($albums); // Shuffles albums
    $j = min(count($albums), 8); // build <li>s from first 8 in gallery list   
    for($i=0; $i < $j; $i++) {
        echo '<li><a href="'.$albums[$i]['url'].'" title="'.$albums[$i]['description'].'">'.$albums[$i]['title'].'</a></li>';
    };
    if (count($albums) > 8) { // the 8 here matches the 8 above
        echo '<li><a href="/projects/index.php" title="See more galleries" >more ...</a></li>';
    };

    echo '
                </ul>
            </li>
           
            <li><a href="/contact.php">Contact</a></li>

        <!-- EDIT ONLY ABOVE THIS LINE -->
        </ul>


        </div><!-- #r2d2-menu -->

        </div><!-- #navigation-background -->
        </div>
    </div>
    </div> <!-- #navigation -->

</div> <!-- #navigation-container -->
    ';
    return false;        // Replaces normal menu
} // END

Offline

#2 2014-08-13 10:22:08

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Drop-down navigation question

It looks you already advanced a bit since you posted this code fragment.

There are two lines that you need to delete and then it should work better.

            <li><a href="/info.php">Info</a></li>
                        
            </ul>  <-- delete
            </li>   <-- delete
            <li><a href="/about/index.php">About Me</a>

Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#3 2014-08-13 10:31:20

kmcintyre
Member
From: TN, USA
Registered: 2012-10-02
Posts: 24
Website

Re: Drop-down navigation question

That did it!  Thanks so much!

Offline

#4 2014-08-13 15:15:44

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Drop-down navigation question

Great! It looks nice now. I have to think about dividing my about page in subpages....


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

Board footer

Powered by FluxBB