Module "News" displays text and graphics sorted by date.
Module refers to the part of the CMS "Content" and can be installed optionally.
Module "News" can be attached to the various pages of the site. If the module is attached to a few pages in the administrative part of the module there is a special filter "section of the website" with the possibility of filtering the output (news list, categories and settings) as belonging to the page.
The module consists of 2 parts: the news categories and news.
In the list of news sorted by date.
The news has the following characteristics.
In the module "News" integrated automatic publication of news in RSS format.
Address RSS-feed: http://site.com/news/rss/.
In the russian version of the site address of the RSS-feed news will look like: http://site.com/ru/news/rss/.
News categories can have an unlimited number of subcategories. If necessary, the category can not be used. To do this, disable the "Use category" in the module settings.
All nested categories and news deleted when you delete a category.
Categories have the following characteristics.
You can save different settings for different module pages to which the module is attached.
Для работы с модулем «News» служат следующие шаблонные теги:
show_block – shows latest news on all pages, except the news page, when the list of the same news as in the function is shown.
Атрибуты:
— count – number of displayed news (by default 3);
— site_id – pages to which the module is attached. Page identifiers are enumerated comma-separated. You can indicate negative value, then the news from the indicated section will be excluded. By default all pages are selected.;
— cat_id – categories of news, if "Use categories" is checked in the module settings. Category identifiers are enumerated comma-separated. You can indicate negative value, then the news from the indicated category will be excluded. You can indicate current value, then the news from the current (opened) category or all categories, if neither of them is opened, will be shown. By default the category is not taken into account, all news is shown.;
— sort – news sorting: date – by date (by default), keywords – news with similar titles for the current page ("Site search" module must be enabled and news indexed);
— images – number of images attached to the piece of news;
— images_variation – image size tag, set in module settings;
— only_module – show the block only on the page to which "News" module is attached: true – show the block only on the module page, by default the block will be shown on all pages;
— tag – tag attached to the news;
— defer – deferred load tag template tag: event – load content only at the request of the user when you click "Upload", emergence – load content only when the client window appears in the browser window, async – asynchronous (simultaneous) content loading together with the content of template tags with the same marker, sync – synchronous (sequential) load of content in conjunction with the content of template tags with the same marker, by default, downloading content only at the request of the user;
— defer_title – text string displayed at the point where the loadable content appears with the help of delayed loading of the template tag;
— template – tag template (file modules/news/views/news.view.show_block_template.php; template by default modules/news/views/news.view.show_block.php).
Формат даты задается в настройках модуля.
Example:
<insert name="show_block" module="news">
выведет 3 последние новости сайта
<insert name="show_block" module="news" count="5">
выведет 5 последних новостей сайта
<insert name="show_block" module="news" count="1" site_id="12">
выведет последнюю новость, прикрепленную к странице 12
В шаблоне тега можно получить значение любого атрибута через переменную $result["attributes"]["название атрибута"]
.
show_block_rel – shows similar news on the page of the piece of news. By default the connection between news are one-sided, this can be changed by checking the option "Link back to parent in the block of similar news" in module settings.
Атрибуты:
— count – number of news shown (by default 3);
— images – number of images attached to the piece of news;
— images_variation – image size tag, set in module settings;
— defer – deferred load tag template tag: event – load content only at the request of the user when you click "Upload", emergence – load content only when the client window appears in the browser window, async – asynchronous (simultaneous) content loading together with the content of template tags with the same marker, sync – synchronous (sequential) load of content in conjunction with the content of template tags with the same marker, by default, downloading content only at the request of the user;
— defer_title – text string displayed at the point where the loadable content appears with the help of delayed loading of the template tag;
— template – tag template (file modules/news/views/news.view.show_block_rel_template.php; template by default modules/news/views/news.view.show_block_rel.php).
Формат даты задается в настройках модуля.
Example:
<insert name="show_block_rel" module="news">
выведет 3 новости, прикрепленные к текущей новости
В шаблоне тега можно получить значение любого атрибута через переменную $result["attributes"]["название атрибута"]
.
show_calendar – shows the calendar with links to the news for a certain period. Periods are shown as links to months, only if there are news correspoding to these periods.
Атрибуты:
— site_id – the page to which the module is attached, one page is selected by default;
— cat_id – news category (category id, all news are taken into account by default), if "Use categories" is checked in module settings;
— detail – detalization (day – days, month – months (by default), year – years);
— only_module – show the block only on "News" page: true – show the block only on module page, by default the block will be shown on all pages;
— defer – deferred load tag template tag: event – load content only at the request of the user when you click "Upload", emergence – load content only when the client window appears in the browser window, async – asynchronous (simultaneous) content loading together with the content of template tags with the same marker, sync – synchronous (sequential) load of content in conjunction with the content of template tags with the same marker, by default, downloading content only at the request of the user;
— defer_title – text string displayed at the point where the loadable content appears with the help of delayed loading of the template tag;
— template – tag template (file modules/news/views/news.view.show_calendar_template.php or modules/news/views/news.view.show_calendar_day_template.php for detalization by days; template by default modules/news/views/news.view.show_calendar.php or modules/news/views/news.view.show_calendar_day.php for detalization by days).
Example:
<insert name="show_calendar" module="news">
выведет календарь новостей
В шаблоне тега можно получить значение любого атрибута через переменную $result["attributes"]["название атрибута"]
.
{news} – News
{news_category} – Категории новостей
{news_category_parents} – Parents relations of категорий новостей
{news_category_rel} – Связи новостей и категорий
{news_counter} – View counter of news
{news_rel} – Связи похожих новостей
The module is located in the folder modules/news and arranged classically.
modules/news/admin/news.admin.php – Editing news;
modules/news/admin/news.admin.category.php – Editing news categories;
modules/news/admin/news.admin.config.php – Module settings;
modules/news/admin/news.admin.counter.php – Viewings statistics;
modules/news/admin/news.admin.menu.php – Map of links for "Menu on the website" module;
modules/news/js/news.show_calendar_day.js – JS-module script;
modules/news/news.php – Controller;
modules/news/news.action.php – Processing Ajax queries;
modules/news/news.install.php – Install of module;
modules/news/news.model.php – Model;
modules/news/news.rss.php – RSS newsfeed;
modules/news/news.search.php – Settings for search indexing for "Search" module;
modules/news/news.sitemap.php – Map of links for "Site map" module;
modules/news/views/m/news.view.show_block.php – News block template for mobile version;
modules/news/views/news.view.first_page.php – Template of the first page of the module, if the settings module checked "Use category";
modules/news/views/news.view.id.php – Template of news page;
modules/news/views/news.view.list.php – Template news list;
modules/news/views/news.view.rows.php – Шаблон список новостей;
modules/news/views/news.view.rows_block.php – Шаблон блока новостей;
modules/news/views/news.view.rows_block_rel.php – Шаблон блока похожих новостей;
modules/news/views/news.view.show_block.php – Template of news block;
modules/news/views/news.view.show_block_rel.php – Template of related news block;
modules/news/views/news.view.show_calendar.php – Template of news archive calendar;
modules/news/views/news.view.show_calendar_day.php – Template of daily news archive calendar.