projectList()

Description

Generates an HTML list of all projects. If the “Hide Section Titles” option is off, then projects are divided into sections.

Here is an example of the default output (note the 'active' class, which is automatically appended for CSS styling):

<ul id="projects">  
    <li>  
        <ul id="print">  
            <li class="sectionTitle">  
                Print  
            </li>  
            <li class="project">  
                <a href="/projects/poster">Poster</a>  
            </li>  
            <li class="project active">  
                <a href="/projects/business-card">Business Card</a>  
            </li>  
        </ul>  
        <ul id="web">  
            <li class="sectionTitle">  
                Web  
            </li>  
            <li class="project">  
                <a href="/projects/photographer-website">Photographer Website</a>  
            </li>  
        </ul>  
    </li>  
</ul>

Usage

<?php  echo projectList( $template ); ?>

Parameters

$template

  • string
  • optional

If you want to replace the default list item with custom HTML, you can supply your own template. The template must be in your theme's templates folder. The default template looks like this:

<li> 
    <a href="<?php echo linkToProject(); ?>"><?php echo projectTitle(); ?></a>  
</li>

Note that the template must, as a minumum, include a list-item tag (<li></li>), otherwise you will screw the HTML.

Examples

Custom template

<?php echo projectList( 'my_template.html' ); ?>