# nats\_display\_news

Alias: display\_news

## Parameters

(*Required parameters in **bold**)*

| Parameter                                                                                                                                 | Description                                                                                                             | Possible Values                                                                                       | Default Value                                                              | Example                         |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------- |
| [tpl](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/tpl)                      | Templates used to display output. Not used if either parameter, *headlines* or *newsid*, is also used                   | Any valid template name                                                                               | The template, *function\_display\_news*                                    | tpl="mytemplate"                |
| headlines                                                                                                                                 | Displays output in the template, *function\_display\_news\_headlines*. Not used if the parameter, *newsid* is also used | 0 or 1 (exclusive)                                                                                    | 0. Will use the template, *function\_display\_news*                        | headlines="1"                   |
| newsid                                                                                                                                    | Displays a single news item using the template, *function\_display\_news\_full*                                         | Any valid news ID number                                                                              | *None.* Display more than one news item                                    | newsid="123"                    |
| time                                                                                                                                      | Only shows news items published before this time                                                                        | Any text the PHP function [strtotime()](http://us.php.net/manual/en/function.strtotime.php) can parse | The current time. Will not show news items with a future publication date. | time="1 August 2008"            |
| count                                                                                                                                     | How many items to show on each page                                                                                     | Zero or any integer greater than zero                                                                 | 5; shows five news items on each page                                      | count="10"                      |
| start                                                                                                                                     | How many previous news items to ignore                                                                                  | Zero or any integer greater than zero                                                                 | 0; ignores no news items -- starts with the first news item                | start="10"                      |
| order                                                                                                                                     | What order to display the news in                                                                                       | Any valid order                                                                                       | ?                                                                          | ?                               |
| section                                                                                                                                   | Limit output to news from one or more categories (sections)                                                             | Any valid section or comma-separated list of sections                                                 | *None.* Shows news from all sections                                       | section="mysection,yoursection" |
| [assign\_prefix](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix) | Prefix output variables with this word. (Click link for details)                                                        | Any valid Smarty variable name                                                                        | *None.* (No prefix is used)                                                | assign\_prefix="myvar"          |
| [data\_only](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/data_only)         | Set variables but don't display the template                                                                            | 1                                                                                                     | *None.* The template is displayed.                                         | data\_only=1                    |

## Output

A list of news items or, if the *newsid* parameter is set, a single complete news item.<br>

| Parameter   | Description                                          |
| ----------- | ---------------------------------------------------- |
| news        | Array of all the news items pulled from the function |
| news\_count | Total count of news items                            |

## Notes

You cannot use a custom template if the parameter *newsid* is also used.

## See Also

* [strtotime()](http://us.php.net/manual/en/function.strtotime.php) -- PHP.net documentation on *strtotime*.
