Description
Outputs a link to the next project in the list. Can also return an array with details about the next project so that you can display the project's title, for example.
Note that this function loops, which means that when the last project is reached, the link returned will point to the first project.
Example array:
Array ( [id] => 114 [title] => The Great Enhancement Debate [slug] => the-great-enhancement-debate [description] => [date] => 1276418757 [section] => 1 [pos] => 3 [flow] => group1:one-by-one,textblock746,group2:one-by-one,textblock767,group3:one-by-one [thumbnail] => greatenhancementdebate.project.jpg [publish] => 1 [thumbnailcenter] => [link] => http://www.mikaelstaer.com/projects/the-great-enhancement-debate )
Usage
<?php echo nextProject(); $next_project= nextProject( $returnData ); ?>
Parameters
$returnData
- boolean: true or false
- optional
- default: false
True will force the function to return an array containing details about the next project.
Examples
Using project details in a link
<?php $next_project= nextProject( true ); ?> <a href="<?php echo $next_project['link']; ?>"><?php echo $next_project['title']; ?></a>
Creating a standard next project link
<a href="<?php echo nextProject(); ?>">Next Project</a>