Skip navigation.
Home

Show sticky nodes

List of nodes marked sticky

Display a list of sticky nodes. This combines a database query with some basic HTML generation.

    The Code:

    <?php
        $sql 
    'SELECT title FROM {node} WHERE sticky = 1';
        
    $ul qp('<?xml version="1.0"?><ul></ul>')
          ->
    query($sql)
          ->
    withEachRow()
          ->
    appendColumn('title''<li/>')
          ->
    top()
          ->
    html();
      
    ?>

    References:

    The QueryPath API