> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_display_news.md).

# nats\_display\_news

Alias: display\_news

## Parameters

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

| Parameter                                                                                                       | Description                                                                                                             | Possible Values                                                                                       | Default Value                                                              | Example                         |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------- |
| [tpl](/nats-admin/skins-and-templates/further-reading/template-function-parameters/tpl.md)                      | 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](/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix.md) | 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](/nats-admin/skins-and-templates/further-reading/template-function-parameters/data_only.md)         | 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*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_display_news.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
