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-16 23:19:44

fwillette
Member
From: Brussels - Belgium
Registered: 2014-05-08
Posts: 135

drop down menu not on the right page ( Solved )

Hello

Site:  http://martine-cheval.be/galleries.php

I have implemented drop down menu and it works, giving the rights infos about abums an albums set, but.....
not on the right page. Albums and album sets are "naturally" loaded in the "Galleries" page, but dropdown menu appears on "Oeuvres récentes" page, whitc is a Stage page.

Here the code I put in phplugins.php:

        <!-- EDIT ONLY BELOW THIS LINE : -->

            <li><a href="/">Home</a></li>
            <li><a href="/stage-derniers-dessins">Oeuvres récentes</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="/galleries.php">Galleries</a>
            <li><a href="/about.php">Mon parcours</a></li>
            <li><a href="/contact.php">Contact</a></li>
            <li><a href="/search/">Recherche de dessins</a></li>


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

Am I wrong or did I miss something.

Cordially

Fredy

Last edited by fwillette (2014-08-20 18:13:47)

Offline

#2 2014-08-16 23:28:19

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: drop down menu not on the right page ( Solved )

That's because you've coded it that way. You've put the Autoindex drop down code on the Stage page.
Just swap their positions in the code.
Swap the <li> item that has the Stage page (right underneath Home) with the one that has the Galleries page.

this: <li><a href="/stage-derniers-dessins">Oeuvres récentes</a>

and this: <li><a href="/galleries.php">Galleries</a>

Last edited by rod barbee (2014-08-16 23:52:47)


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2014-08-17 00:10:22

fwillette
Member
From: Brussels - Belgium
Registered: 2014-05-08
Posts: 135

Re: drop down menu not on the right page ( Solved )

Ok. I swapped these two pages; it is the solution I was thinking about.
The question underneath was: the drop down menu is it linked to the second page? In other words, was it possible to swap the drop down menu instead of swapping the two pages?
Coding is absolutely not my way.

Thanks again Rod

Fredy

Offline

#4 2014-08-17 00:19:51

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: drop down menu not on the right page ( Solved )

Sure. If you wanted the Stage page before the Galleries page in the menu, just move the code for the Stage link above the code for Galleries


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2014-08-17 00:53:55

fwillette
Member
From: Brussels - Belgium
Registered: 2014-05-08
Posts: 135

Re: drop down menu not on the right page ( Solved )

I didn't really understand your first answer.
Now can I juggle with this

Thanks

Fredy

Offline

Board footer

Powered by FluxBB