I have the following code as another way to make a horizontal nav menu. How could I make it so the last menu title doesnt have the "|" character on it? ex of how it currently looks: 1 | 2 | 3 | 4 |
1. That is possible. The album menu prints a unordered html list (which is semantic for menus) that you can style via CSS to be horizontally. Please try a web search on that, there are plenty of tutorials.
How would I write that correctly, so it inserts a | only if there is another album? This I know I wrote incorrectly, but improving on understanding.. ` <?php while (next_album()): ?> " title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?> | <?php if(next_album()) { echo " | "; }?> <?php else(next_album()) {echo 'null' };} ?> <?php endwhile; ?> ` Thanks for your help!
Comments
I have the following code as another way to make a horizontal nav menu. How could I make it so the last menu title doesnt have the "|" character on it? ex of how it currently looks: 1 | 2 | 3 | 4 |
`
<?php while (next_album()): ?>
" title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?> |
<?php endwhile; ?>
`
2. Try something like `if(next_album()) { echo " | "; }`
`
<?php while (next_album()): ?>
" title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?> |
<?php if(next_album()) { echo " | "; }?>
<?php endwhile; ?>
`
it printed an endless navigation list (browser crash, oops)
How would I write that correctly, so it inserts a | only if there is another album?
This I know I wrote incorrectly, but improving on understanding..
`
<?php while (next_album()): ?>
" title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?> |
<?php if(next_album()) { echo " | "; }?>
<?php else(next_album()) {echo 'null' };} ?> <?php endwhile; ?>
`
Thanks for your help!
`<?php if (is_null(getNextAlbum())) { echo null; } else { echo " | " ; } ?>`
thank you so much for your help