Articles
Module "Articles" displays articles.
Module refers to the part of the CMS "Content" and can be installed optionally.
Module "Articles" 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 (a list of articles, categories and settings) as belonging to the page.
The module consists of two parts: a category of articles, and articles.
Articles
In the article are displayed with priority according to the importance and manual sorting.
Articles have the following characteristics.
Основные:
- Name – Used in link to article and headers. The parameter has different values for different language versions of the site.
- Date – Entered in the format dd.mm.yyyy hh:mm. Articles older than the current date will be displayed on the site, since that date.
- Published – If not checked, the article will not be published. The parameter has different values for different language versions of the site.
- Category – The category to which the article belongs. Categories list is edited in the tab above. Possible to select additional categories in which the item will also be published. To select multiple categories, hold down the CTRL(Win) or Command(Mac). The parameter is enabled if checked "Use the category" option in the module settings.
- Images – Images will be automatically uploaded after choice. After uploading images will be automatically processed according to module settings. Parameter is shown if "Use images" option is enabled in module settings.
- Short description – Short description of the article. If you select "Add to the description", on Article's page Short description will show together with the Full text of Article. Otherwise, the Short description will show only the list, but on a Article's page is only a Full text. If you select "Use typography", the content will be formatted according to the rules of typography screen with web service "Tipography". Option "HTML-code" allows you to disable the visual editor for the current field. This setting will be taken in the subsequent editing. The parameter has different values for different language versions of the site.
- Text of the article – Full text for the article page. If checked "Use typography", the content will be formatted according to the rules of typography screen with web service "Tipography". Option "HTML-code" allows you to disable the visual editor for the current field. This setting will be taken in the subsequent editing. The parameter has different values for different language versions of the site.
- Dynamic blocks.
- Tags – Tagging article. You can either add a new tag, or you can open and select from existing tags. Option will be displayed if the settings module enabled "Connect tags".
- Related articles – Selecting and adding to the current article links to other articles. Similar articles can shown by diafan's tag show_block_rel. By default, the links between articles are one-way, you can change this by checking the "Link back to parent in the block of similar articles" in the module settings.
- Views counter – Number of views of current article. Statistics is available if the "Connect of views counter" is checked in the module settings.
- Comments – Comments that left users to the current article. Option will be displayed if the settings module enabled "Show comments to articles".
- Rating – Average rating according to voting site users. Option will be displayed if the settings module enabled "Connect rating to articles".
Дополнительные:
- ID – Element number in a DB (for web master and programmer).
- Editor – Changes after the first saving. Shows site administrator who edited this site page at first.
- Last Modify – Changes after element saving. Is shown in title Last Modify.
- Site section – Moving article to a different page, which is attached to the module. Option will be displayed if the module is disabled in the settings option "Use category" if the option is connected, the section of the site is defined the same as in the main category.
- Parameters SEO.
- Window title in a browser, Title tag – If not filled, the tag Title be automatically generated as " Article Title - Page Title - Site Name " or according to the templates of the autogenerate module settings (SEO-specialist). The parameter has different values for different language versions of the site.
- Keywords, Keywords tag – If empty - Keywords tag will be automatically generated according to templates of automatic generation from module settings (for SEO-expert). The parameter has different values for different language versions of the site.
- Description, Description tag – If empty - Description tag will be automatically generated according to templates of automatic generation from module settings (for SEO-expert). The parameter has different values for different language versions of the site.
- Canonical tag – The parameter has different values for different language versions of the site.
- Semantic URL – Clean URLs, i.e. the page address of a type: http://site.ru/psewdossylka/. See site parameters (for SEO-expert).
- Redirect to current page from the page – Allows to redirect from the specified page to the current one.
- Do not index – Inhibit for indexation of current page. If checked the page will have a tag:
<meta name = "robots" content = "noindex">
(for SEO-expert). - Changefreq – Probable frequency of page changes. This value is used for generating of sitemap.xml file. Read more in the description XML-format of a file Sitemap (for SEO-expert).
- Priority – Priority of URL concerning other URL on your site. This value is used for generating of sitemap.xml file. Read more in the description XML-format of a file Sitemap (for SEO-expert).
- Display options.
- Do not show on a sitemap – Hides links to an article in the file and sitemap.xml module "Sitemap".
- Access – If you check "Access Only", see the article on the site that only authorized users marked types. Not authorized, including crawlers, see "404 Page Not Found" (the site administrator).
- Display period – If complete, the current article will be published on the site during this period. At other times, users of the site will not see the article, getting a 404 "Page Not Found" (the site administrator).
- Sorting: set before – Change the position of the current articles among other articles. The field can be edited only for items that are published on the site (for site administrator).
- Templates.
- Page template – Possibility to connect to the page template site a great article from the main (themes/site.php). All templates for the site should be stored in a folder themes with the extension .php (for example, themes/dizain_so_slajdom.php). More in section "Website templates". (webmaster and programmer, do not change this setting unless you know the result!).
- Module template – Template output module on the page content of a separate article (webmaster and programmer, do not change this setting unless you are confident as a result!).
- Indexing for search – Article automatically indexed for module "Search" when making changes.
- Indexing for sitemap – Article automatically indexed sitemap sitemap.xml.
In the "Articles" module integrated automatic publication of articles in RSS format.
Address RSS-feed: http://site.com/clauses/rss/.
In the russian version of the site address of the RSS-feed news will look like: http://site.com/ru/clauses/rss/.
Categories
Categories of the articles 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.
When deleting a category will delete all sub-categories and articles.
Categories have the following characteristics.
Основные:
- Name – Is used in links to category, titles. The parameter has different values for different language versions of the site.
- Published – If unchecking the site visitors will not see the category. The parameter has different values for different language versions of the site.
- Create item in menu – If this field is selected item with link to the current category will be created in "Site menu" module.
- Images – Possibility of uploading of several images. Variants of images size are specified in settings. Parameter is shown if "Use images for categories" option is enabled in module settings.
- Short description – Short description of a category. If "Add to description" is selected, the Short description will be shown on element's page with the Full description. Otherwise the Short description will be shown in the list, and a item's page will show only the Full description. If "Use typography" is on, the content will be formatted according to rules of screen typographics using web service "Typography". Option "HTML-code" allows you to disable the visual editor for the current field. This setting will be taken in the subsequent editing. The parameter has different values for different language versions of the site.
- Description – If "Use typography" is on, the content will be formatted according to rules of screen typographics using web service "Typography". Option "HTML-code" allows you to disable the visual editor for the current field. This setting will be taken in the subsequent editing. The parameter has different values for different language versions of the site.
- Dynamic blocks.
- Comments – Comments from users to the current category. Parameter is shown, if the option "Show comments to category" is enabled in module settings.
- Rating – Average rating according to voting of site users. Parameter is shown, if the parameter "Enable rating to category" is enabled in module settings.
- Indexing for search – The category is automatically indexed for "Site search" module at modification.
- Indexing for sitemap – The category is automatically indexed for sitemap sitemap.xml.
Дополнительные:
- ID – Element number in a DB (for web master and programmer).
- Editor – Changes after the first saving. Shows site administrator who edited this site page at first.
- Last Modify – Changes after element saving. Is shown in title Last Modify.
- Site section – Moving of category to other page of a site, to which the module is attached (for site administrator).
- Parameters SEO.
- Window title in a browser, Title tag – If empty - Title tag will be automatically generated as "Photo name - Page name - Site name", or according to templates of automatic generation from module settings (for SEO-expert). The parameter has different values for different language versions of the site.
- Keywords, Keywords tag – If empty - Keywords tag will be automatically generated according to templates of automatic generation from module settings (for SEO-expert). The parameter has different values for different language versions of the site.
- Description, Description tag – If empty - Description tag will be automatically generated according to templates of automatic generation from module settings (for SEO-expert). The parameter has different values for different language versions of the site.
- Canonical tag – The parameter has different values for different language versions of the site.
- Semantic URL – Clean URLs, i.e. the page address of a type: http://site.ru/psewdossylka/. See site parameters (for SEO-expert).
- Redirect to current page from the page – Allows to redirect from the specified page to the current one.
- Do not index – Inhibit for indexation of current page. If checked the page will have a tag:
<meta name = "robots" content = "noindex">
(for SEO-expert). - Changefreq – Probable frequency of page changes. This value is used for generating of sitemap.xml file. Read more in the description XML-format of a file Sitemap (for SEO-expert).
- Priority – Priority of URL concerning other URL on your site. This value is used for generating of sitemap.xml file. Read more in the description XML-format of a file Sitemap (for SEO-expert).
- Display options.
- Do not show on a sitemap – Hides link to category in sitemap.xml file and "Sitemap" module.
- Nesting: belongs to – Moving of a current category and all its subcategories to another category (for site administrator).
- Sorting: set before – Sorting of categories in the list. Field can be edited only for the categories displayed on a site.
- Access – If option "Access only" is on, the category will be visible only by authorised site users, for marked types. Unauthorised users including search robots will see "404 Page not found" (for site administrator).
- Templates.
- Page template – Possibility to enable template of a site for a category page which differs from the main one (themes/site.php). All site templates should be located in a folder themes with extension .php (for example, themes/dizain_so_slajdom.php). Read more in section "Site templates". (For webmaster and programmer. Do not modify this parameter unless you are sure about the result!).
- Module template – Content template output module on the page a list of articles in this category (webmaster and programmer, do not change this setting unless you are confident as a result!).
- Module template for nested articles – Template output module on the page content of a separate article, embedded in the current category (webmaster and programmer, do not change this setting unless you are confident as a result!).
Statistics
Settings
- Main.
- Quantity of items per page – Number of simultaneously displayed items in the list.
- Date format – Format date in the module.
Possible values:
- 01.05.2016,
- 01.05.2016 14:45,
- 1 may 2016,
- 1 may,
- 1 may 2016, monday,
- yesterday 15:30,
- do not show.
- Categories.
- Show all list articles on article mail page – By default, the first page displays a list of categories with a few articles. This parameter appears if the option marked "Enable categories".
- Enable categories – Enable/disable categories of articles.
- Articles quantity in the category list – The number of articles that appear in the list of categories on the main page. This parameter appears if the option marked "Enable categories".
- Number of categories per page – The number of simultaneously displayed in the list of categories on the first page of the module. This parameter appears if the option marked "Enable categories".
- Number of articles in the list of nested categories – For the module first page and for category page. This parameter appears if the option marked "Enable categories".
- Show articles subcategories – If checked, the list of articles category will shown all articles of nested categories. This parameter appears if the option marked "Enable categories".
- Images.
- Use images – Allows you to enable/disable loading images to articles.
- Generate sizes of images – Images that are defined in the module "Images" tag and Latin letters to connect image on the site. Must be set in two sizes: thumb image in the list of articles (tag medium) and the full image (tag large).
- Display of images in the list – Parameter accepts:
- no (disables images in the list);
- one image;
- show all images. Option will be displayed if the option "Use Image".
- Use images for categories – Allows to enable/disable uploading of images to categories.
- Generate the sizes of images for categories – Sizes of images set in "Image" module and tag by Latin letters for enabling of the image on a site. Two sizes are required: preview images in file list (tag medium) and full image (tag large). Parameter is shown if "Use images for categories" option is selected.
- Display images in categories list – Parameter accepts:
- no (disables images in the list);
- one image;
- show all images. Option will be displayed if the option "Use images for categories".
- Use animation when increasing images – Parameter adds JavaScript code, allowing to enable animation when increasing images. Parameter is shown if "Use images" option is selected.
- Maximum size of uploaded files – Parameter shows maximum admissible size of uploaded files set in hosting settings. Parameter is shown if "Use images" option is selected.
- Apply settings to earlier uploaded images – Allows to reconvert the size of already uploaded images. The button is necessary, if settings of images sizes were modified. Parameter is shown if "Use images" option is selected.
- Options.
- Views counter – Allows you to count the number of views of a separate article.
- Show counter on a site – Allows count of views of a separate article. Option will be displayed if the option "Counter views". This parameter appears if the option marked "Views counter".
- Enable comments to articles – Connecting the "Comments" module. The parameter will not be active if the module "Comments" is not installed. For details, see. In the [module "Comments"] (http://www.diafancms.com/dokument/full-manual/upmodules/comments/).
- Show comments to categories – Connecting the "Comments" to the categories of articles. The parameter will not be enabled if the module "Comments" is not installed. For details, see. In the [module "Comments"] (http://www.diafancms.com/dokument/full-manual/upmodules/comments/).
- Enable tags – Enabling of "Tags" module. Parameter will not be enabled if "Tags" module is not installed. See more information in section "Tags" module.
- Connect rating articles – Enabling of "Rating" module. Parameter will not be enabled if "Rating" module is not installed. See more information in section "Rating" module.
- Enable rating to categories – Connection of "Rating" module to categories. Parameter will be off if "Rating" module is not installed. See more information in "Rating" module.
- Enable relinking – Use linking in the module. See more information in section "Site Links" module.
- Link back to parent in the block of similar articles – If noted that the appointment of article A similar article B, from B articles will automatically be similar article by A.
- Autogenerate for SEO.
- Template for automatic generating Title – If the template set and the article is not registered title Title, then the header is automatically generated template. In the template, you can add:
- %name – name,
- %category – the category name,
- %parent_category – name top-level categories (SEO-specialist).
The parameter has different values for different language versions of the site. - Template for automatic generating of Title for a category – If the template set and the category is not registered title Title, then the header is automatically generated template. In the template, you can add:
- %name – the name of the category,
- %parent – the name of the top-level categories,
- %page – page (text can be changed in the interface "Languages" – "Translation Interface") (SEO-specialist).
The parameter has different values for different language versions of the site. This parameter appears if the option marked "Enable categories". - Template for automatic generating Keywords – If the template set and the article is not filled Keywords, then the field Keywords automatically generated template. In the template, you can add:
- %name – name,
- %category – the category name,
- %parent_category – name top-level categories (SEO-specialist).
The parameter has different values for different language versions of the site. - Template for automatic generating Keywords for a category – If the template set and the category is not filled Keywords, then the field Keywords automatically generated template. In the template, you can add:
- %name – the name of the category,
- %parent – the name of the top-level categories (SEO-specialist).
The parameter has different values for different language versions of the site. This parameter appears if the option marked "Enable categories". - Template for automatic generating Description – If the template set and the article is not filled Description, then the field Description automatically generated template. In the template, you can add:
- %name – name,
- %category – the category name,
- %parent_category – name top-level categories,
- %anons – short description (SEO-specialist).
The parameter has different values for different language versions of the site. - Template for automatic generating of Description for a category – If the template set and the category is not filled Description, then the Description field is automatically generated template. In the template, you can add:
- %name – the name of the category,
- %parent – the name of the top-level categories,
- %anons – short description (SEO-specialist).
The parameter has different values for different language versions of the site. This parameter appears if the option marked "Enable categories". - Templates.
- Template for elements list – By default, modules/clauses/views/clauses.view.list.php. Option for the developers! Do not install unless you know the result.
- Template for the module first page (if categories are enabled) – By default, modules/clauses/views/clauses.view.fitst_page.php. Option for the developers! Do not install unless you know the result.
- Template for element page – By default, modules/clauses/views/clauses.view.id.php. Option for the developers! Do not install unless you know the result.
- Additionally.
- Diferent item in administration menu for each section of a site – If the module is attached to several pages, selection of this parameter will show several items in administrative menu for convenience of fast access (for site administrator).
- Indexing for sitemap – When modyifying settings publish of page, the module is automatically reindexed sitemap.xml.
Template tags
Для работы с модулем «Articles» служат следующие шаблонные теги:
show_block – shows latest articles on all pages, except the articles page, when the list of the same articles as in the function is shown.
Атрибуты:
— count – number of displayed articles (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 articles from the indicated section will be excluded. By default all pages are selected;
— cat_id – categories of articles, if "Use categories" is checked in the module settings. Category identifiers are enumerated comma-separated. You can indicate negative value, then the articles from the indicated category will be excluded. You can indicate current value, then the articles 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 articles are shown.;
— sort – sorting articles: by default as on the module page, date – by date, rand – randomly, keywords – articles with similar titles for the current page ("Site search" module must be enabled and articles indexed);
— images – number of images attached to the article;
— images_variation – image size tag, set in module settings;
— only_module – show the block only on the page to which "Articles" 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 articles;
— 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/clauses/views/clauses.view.show_block_template.php; template by default modules/clauses/views/clauses.view.show_block.php).
Example:
<insert name="show_block" module="clauses">
выведет 3 статьи сайта
<insert name="show_block" module="clauses" count="5" sort="date">
выведет 5 последних статей сайта
<insert name="show_block" module="clauses" count="1" cat_id="35">
выведет одну статью сайта, из раздела статей с id=35
В шаблоне тега можно получить значение любого атрибута через переменную $result["attributes"]["название атрибута"]
.
show_block_rel – shows similar articles on the page of the article. By default the connection between articles are one-sided, this can be changed by checking the option "Link back to parent in the block of similar articles" in module settings.
Атрибуты:
— count – number of articles shown (by default 3);
— images – number of images attached to the article;
— 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/clauses/views/clauses.view.show_block_rel_template.php; template by default modules/clauses/views/clauses.view.show_block_rel.php).
Формат даты задается в настройках модуля.
Example:
<insert name="show_block_rel" module="clauses">
выведет 3 статьи, прикрепленные к текущей статье
В шаблоне тега можно получить значение любого атрибута через переменную $result["attributes"]["название атрибута"]
.
Database
{clauses} – Articles
{clauses_category} – Категории статей
{clauses_category_parents} – Parents relations of категорий статей
{clauses_category_rel} – Связи статей и категорий
{clauses_counter} – View counter of articles
{clauses_rel} – Связи похожих статей
Files
The module is located in the folder modules/clauses and arranged classically.
modules/clauses/admin/clauses.admin.php – Editing articles;
modules/clauses/admin/clauses.admin.category.php – Editing categories of articles;
modules/clauses/admin/clauses.admin.config.php – Module settings;
modules/clauses/admin/clauses.admin.counter.php – Viewings statistics;
modules/clauses/admin/clauses.admin.menu.php – Map of links for "Menu on the website" module;
modules/clauses/clauses.php – Controller;
modules/clauses/clauses.install.php – Module installation;
modules/clauses/clauses.model.php – Model;
modules/clauses/clauses.rss.php – RSS articles feed;
modules/clauses/clauses.search.php – Settings for search indexing for "Search" module;
modules/clauses/clauses.sitemap.php – Map of links for "Site map" module;
modules/clauses/views/clauses.view.first_page.php – Template of the first page of the module, if the settings module checked "Use category";
modules/clauses/views/clauses.view.id.php – Template of article page;
modules/clauses/views/clauses.view.list.php – Articles list template;
modules/clauses/views/clauses.view.rows.php – Articles list template;
modules/clauses/views/clauses.view.rows_block.php – Articles list template for articles block;
modules/clauses/views/clauses.view.rows_block_rel.php – Articles list template for simular articles block;
modules/clauses/views/clauses.view.show_block.php – Template of articles block;
modules/clauses/views/clauses.view.show_block_rel.php – Template of similar articles block.