Nats display news
From TMM Wiki
Jump to navigationJump to searchApplies to NATS 4.0.25 and greater.
nats_display_news
Displays a list of affiliate news items. The list may be restricted and formatted using the parameters described below.
Alias: display_news
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
tpl | Template 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 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 | 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 | 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.
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 -- PHP.net documentation on strtotime.