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.
You are not logged in.
Pages: 1
Hello
I am building my own site and experimenting things like Drop menu with autoindex.
If I well understood, Drop menu with autoindex can only provide one level sub menu, like in Galeries pages, thus Would I add one or more galleries pages. I uploaded an AutoIndex (called voyages) at the root and created a publisher instance to publish there and it works. Next step is to implement drop menu with autoindex for this new item. I tried to paste code, adapted for that page, but the result is not exactly what I hoped. I even don't know if it is possible. That is what my phpligins.php code is looking now:
<!-- EDIT ONLY BELOW THIS LINE : -->
<li><a href="/">Home</a></li>
<li><a href="/galleries.php">Galeries</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="/voyages/">Voyages</a>
</ul>
';
$theroot = $_SERVER['DOCUMENT_ROOT'];
$indexPath = '/voyages/'; // 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="/voyages/" title="See more galleries" >more ...</a></li>';
};
echo '
</ul>
</li>
<li><a href="/contact.php">Contact</a></li>
<li><a href="/search/"><i style="color:red;"class="fa fa-search"></i> Recherche de photos</a></li>
<li><a href="/about.php">About</a></li>
<li><a href="/info.php"><i style="color:green;"class="fa fa-info-circle"></i> Infos utiles</a></li>
<!-- EDIT ONLY ABOVE THIS LINE -->
Am I dreaming or is it simply a "little" code missing. I apologise but my knowledges coding are near absolute zero.
http://www.martine-cheval.be/
Lightroom CC2015
Offline
This is probably the problem:
<li><a href="/voyages/">Voyages</a>
</ul>
You've got a closing ul tag </ul> where is should be an opening tag <ul>
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Fine
Works now like expected.
Not sur I could point it by myself. Rod you are great.
Thanks a million times.
http://www.martine-cheval.be/
Lightroom CC2015
Offline
May I?
Seems that the number of albums beeing detected is limited to 8 in the example.
Is it a technical reason, or is it for display cleanliness?
http://www.martine-cheval.be/
Lightroom CC2015
Offline
cleanliness I suspect. But you can change that. Just change the number in this line of code:
$j = min(count($albums), 8); // build <li>s from first 8 in gallery list
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Pages: 1