prevProject()

Description

Outputs a link to the previous project in the list. Can also return an array with details about the previous project so that you can display the project's title, for example.

Example array:

Array 
( 
    [id]        => 114 
    [title]     => The Great Enhancement Debate 
    [slug]      => the-great-enhancement-debate 
    [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 
    [link]      => http://www.mikaelstaer.com/projects/the-great-enhancement-debate 
)

Usage

<?php 
    echo prevProject(); 
    $prev_project= prevProject( $returnData ); 
?>

Parameters

$returnData

  • 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 $prev_project= prevProject( true ); ?>
<a href="<?php echo $prev_project['link']; ?>"><?php echo $prev_project['title']; ?></a>

Creating a standard next project link

<a href="<?php echo prevProject(); ?>">Prev Project</a>