Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.1.1. How to do article pagination?        5.1.3. How to make a hard-coded link to an article?>

Print / Download:
Available languages: english Last update: 2005-09-21 11:23:10

5.1.2. How to display the most recently published articles?

This example will show you how to list the most recent news.  It also demonstrates how to display an image that is linked to an article, and how to make a hyperlink to an article.

The example given below will make your page look something like this:



Note: CSS styles have been removed from the example below to make it easier to read, so if you use the code below, it will not look exactly as shown above; the colors will not be there, and the spacing will be a bit different.

        <!** local>
        <!** publication campware>
        <!** issue 1>
        <!** section off>
        <!-- Display all news articles on the front page, most recent first -->
        <!** list length 10 article type is news OnFrontPage is on order bydate desc>
        <table width="100%">
        
        <!-- Article date -->
        <tr>
            <td>
                <!** print article date "%M %d, %Y">
            </td>
        </tr>
        
        <!-- Article -->
        <tr>
            <td>
                
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>    
                    <td valign="top">
                        <table>
                        <!-- Article Headline -->
                        <tr>
                            <td valign="top" align="left">
                                <a href="<!** URI>"><!** print article name></a>
                            </td>
                        </tr>
                        <!-- Article Intro -->
                        <tr>
                            <td valign="top" align="left">
                                <!** print article intro>  
                            </td>
                        </tr>
                        <!-- Read more -->
                        <tr>
                            <td valign="top" align="left">  
                                <a href="<!** URI>"><nobreak>Read More...</nobreak></a>
                            </td>
                        </tr>
                        </table>
                    </td>
                    
                    <!-- Optional image -->
                    <!** if image 1 >
                    <td rowspan="2" valign="top" align="right">
                        <img src="/cgi-bin/get_img?<!** urlparameters image 1>" border="0" vspace="0" hspace="0">
                    </td>
                    <!** endif>
                </tr>
                </table>
            </td>
        </tr>
        </table>
        <!-- END Article -->
        <!** endlist>
        <!** endlocal>

      


add a note add a note User Contributed Notes
5.1.2. How to display the most recently published articles?
There are no user contributed notes for this page.

<5.1.1. How to do article pagination? 5.1.3. How to make a hard-coded link to an article?>

  Last update: 2005-09-21 11:23:10
Website powered by Docmint Last update: 2005-09-21 11:23:10
Total page time: 0.978469133377