MODx/Подключаемые сниппеты/Sitemap: различия между версиями

Содержимое удалено Содержимое добавлено
Нет описания правки
Строка 3:
'''Sitemap''' — это сниппет для MODx, который даёт возможность автоматически создавать так называемый [http://www.google.com/support/webmasters/bin/answer.py?answer=40318&topic=13450 Sitemap] Вашего Сайта. Данный XML-файл предоставляет Google представление о Вашем Сайте.
Проще говоря, файл Sitemap - это список страниц вашего веб-сайта. Создание и отправка файла Sitemap позволяют обеспечить наличие данных в системе Google обо всех страницах на вашем сайте, включая URL-адреса, которые невозможно обнаружить в ходе стандартного процесса сканирования Google.
 
=== Параметры ===
 
; <tt>&format</tt>
: отвечает за установку формата файла
:; Значения
:: <tt>sp</tt> - для Google sitemap с использование Sitemap Protocol формата (XML).
:: <tt>txt</tt> - на выходе список URLs в виде текста.
:; По умолчанию
:: <tt>sp</tt> - Google sitemap.
 
; <tt>&startid</tt>
: позволяет указать какая часть сайта будет помещенеа в sitemap.
:; Значения
:: <tt>integer</tt> - ID документа с которого начнется sitemap.
:; По умолчанию
:: <tt>0</tt> - корень сайта.
 
; <tt>&priority</tt>
: позволяет добавлять приоритетность документов.
:; Значения
:: <tt>string</tt> - The name of the template varialbe.
:; По умолчанию
:: <tt>sitemap_priority</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Input type: Dropdown list.
:: Input option values:<code>[php,N]5==1.0||4==0.7||3==0.5||2==0.3||1==0.0</code>You may use more or less values if you wish.
:: Default value: <tt>0.5</tt>
 
; <tt>&changefreq</tt>
:Позволяет установить частоту обновления для каждого документа на сайте (только для Sitemap Protocol).
:; Значения
:: <tt>string</tt> - Имя переменной шаблона (The name of the template variable).
:; По умолчанию
:: <tt>sitemap_changefreq</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Способ ввода: Выпадающее меню.
:: Возможные значения:<code>[php,N]Always==always||Hourly==hourly||Daily==daily||Weekly==weekly||Monthly==monthly||Yearly==yearly||Never==never</code>
:: Значение по умолчанию: <tt>monthly</tt> (ежемесячно) Выглядит разумно.
 
; <tt>&excludeTemplates</tt>
: Позволяет исключить документы, использующие определённый шаблон.
:; Значения
:: <tt>string</tt> - Разделённые запятыми номера шаблонов (Comma-separated list of document template names).
:; По умолчанию
:: <tt>null</tt> - Ничего не исключается.
 
; <tt>&excludeTV</tt>
: Allows to exclude documents with use of a template variable. Setting the value for this template variable to <tt>1</tt> will exclude the document from the sitemap. This setting is independet of <tt>&excludeTemplates</tt>.
:; Значения
:: <tt>string</tt> - The name of the template variable.
:; По умолчанию: <tt>sitemap_exclude</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Способ ввода: Выпадающее меню.
:: Input option values:<code>[php,N]Include==0||Exclude==1</code>
:: По умолчанию: <tt>0</tt>.
 
; <tt>&excludeWeblinks</tt>
: Исключает внешние ссыки из карты сайта ( Exclude weblinks from the sitemap).
: принимаются двоичные значения (Accepts a boolean value)
 
 
== Инструкции ==
 
=== Установка ===
 
 
 
1) Скачайте исходный код ( [http://modxcms.com/assets/snippets/repository/repo_download/download.php?dwnParam=YXNzZXRzL3JlcG9zaXRvcnl8MjE2OHxyZXBvX2Rjb3VudHxyZXBvLTIxNjgudHh0fHNpdGVtYXBfMS4wLjgudHh0 версия 1.0.8] ).
Строка 20 ⟶ 79 :
5) Сохраните
 
=== ПримерНастройка ===
 
1) Создайте документ в <u>корне сайта</u>
Строка 103 ⟶ 162 :
</code>
 
== Примеры Вызова (eng) ==
= Дополнительно =
 
<code>[php,N][!sitemap!]</code> Will
* include all published documents from the whole site;
* will exclude documents with the template variable named <tt>sitemap_exclude</tt> set to <tt>1</tt>;
* will use Sitemap Protocol format (XML);
* and will set change frequency and priority for documents if template variables with default names (<tt>sitemap_changefreq</tt> and <tt>sitemap_priority</tt>) exist.
 
<code>[php,N][!SiteMap? &format=`txt` &stardid=`28`!]</code> Will
* output a plain text list
* with URLs of all published documents
* being descendants of document with ID 28.
 
<code>[php,N][!SiteMap? &excludeTemplates=`blank, hidden` &excludeTV=`hide`!]</code>Will
* output a sitemap in Sitemap Procotol format;
* will exclude documents using <tt>blank</tt> and <tt>hidden</tt> templates;
* will exclude documents with the template variable named <tt>hide</tt> set to <tt>1</tt>;
* will include documents from the whole site;
* and will set change frequency and priority for documents if template variables with default names (<tt>sitemap_changefreq</tt> and <tt>sitemap_priority</tt>) exist.
 
 
 
== Дополнительно ==
 
;Автор: Grzegorz Adamiak ([[User:Grad|grad]])
Строка 109 ⟶ 190 :
;Тип лицензии: LGPL
;MODx: 0.9.2.1
;Страничка проэкта на сайте MODx: http://modxcms.com/sitemap-711.html
;Ветка форума (англ.): http://modxcms.com/forums/index.php?topic=5754
 
 
= History =
== История версий (eng) ==
; # 1.0.6:
: - Optional parameter to exclude weblink from sitemap
Строка 128 ⟶ 208 :
:- First public release.
 
== Ссылки ==
 
;Страничка проэкта на сайте MODx: http://modxcms.com/sitemap-711.html
=== Parameters ===
;Ветка форума (англ.): http://modxcms.com/forums/index.php?topic=5754
 
; <tt>&format</tt>
: отвечает за установку формата файла
:; Значения
:: <tt>sp</tt> - для Google sitemap с использование Sitemap Protocol формата (XML).
:: <tt>txt</tt> - на выходе список URLs в виде текста.
:; По умолчанию
:: <tt>sp</tt> - Google sitemap.
 
; <tt>&startid</tt>
: позволяет указать какая часть сайта будет помещенеа в sitemap.
:; Значения
:: <tt>integer</tt> - ID документа с которого начнется sitemap.
:; По умолчанию
:: <tt>0</tt> - корень сайта.
 
; <tt>&priority</tt>
: позволяет добавлять приоритетность документов.
:; Значения
:: <tt>string</tt> - The name of the template varialbe.
:; По умолчанию
:: <tt>sitemap_priority</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Input type: Dropdown list.
:: Input option values:<code>[php,N]5==1.0||4==0.7||3==0.5||2==0.3||1==0.0</code>You may use more or less values if you wish.
:: Default value: <tt>0.5</tt>
 
; <tt>&changefreq</tt>
:Allows to set the change frequency for each document on the site (only for the Sitemap Protocol).
:; Значения
:: <tt>string</tt> - The name of the template variable.
:; По умолчанию
:: <tt>sitemap_changefreq</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Input type: Dropdown list.
:: Input option values:<code>[php,N]Always==always||Hourly==hourly||Daily==daily||Weekly==weekly||Monthly==monthly||Yearly==yearly||Never==never</code>
:: Default value: <tt>monthly</tt> seems reasonable.
 
; <tt>&excludeTemplates</tt>
: Allows to exclude documents that use templates specified.
:; Значения
:: <tt>string</tt> - Comma-separated list of document template names.
:; По умолчанию
:: <tt>null</tt> - No document are excluded.
 
; <tt>&excludeTV</tt>
: Allows to exclude documents with use of a template variable. Setting the value for this template variable to <tt>1</tt> will exclude the document from the sitemap. This setting is independet of <tt>&excludeTemplates</tt>.
:; Значения
:: <tt>string</tt> - The name of the template variable.
:; По умолчанию: <tt>sitemap_exclude</tt> - Not used if the template variable specified will not be found.
:; Example of template variable
:: Input type: Dropdown list.
:: Input option values:<code>[php,N]Include==0||Exclude==1</code>
:: Default value: <tt>0</tt>.
 
; <tt>&excludeWeblinks</tt>
: Exclude weblinks from the sitemap.
: Accepts a boolean value
 
=== Example calls ===
 
<code>[php,N][!sitemap!]</code> Will
* include all published documents from the whole site;
* will exclude documents with the template variable named <tt>sitemap_exclude</tt> set to <tt>1</tt>;
* will use Sitemap Protocol format (XML);
* and will set change frequency and priority for documents if template variables with default names (<tt>sitemap_changefreq</tt> and <tt>sitemap_priority</tt>) exist.
 
<code>[php,N][!SiteMap? &format=`txt` &stardid=`28`!]</code> Will
* output a plain text list
* with URLs of all published documents
* being descendants of document with ID 28.
 
<code>[php,N][!SiteMap? &excludeTemplates=`blank, hidden` &excludeTV=`hide`!]</code>Will
* output a sitemap in Sitemap Procotol format;
* will exclude documents using <tt>blank</tt> and <tt>hidden</tt> templates;
* will exclude documents with the template variable named <tt>hide</tt> set to <tt>1</tt>;
* will include documents from the whole site;
* and will set change frequency and priority for documents if template variables with default names (<tt>sitemap_changefreq</tt> and <tt>sitemap_priority</tt>) exist.