Dittoのオプション
「Ditto」スニペットは特定のフォルダ以下のドキュメントを一覧表示するものです。
「NewsListing」と同じくブログ形式の表示に適しています。
オプションの指定をまとめてみました(完全ではありませんのであしからず)
// ---------------------------------------------------
// Parameters
// ---------------------------------------------------
$mode = isset($mode)? $mode : "development";
// determines whether variable sanity checks are run.
// use "development" while creating the snippet call and "production" when your site goes live for a little speed boost.
$startID = isset($startID) ? $ditto->cleanStartIDs($startID, $mode) : $modx->documentIdentifier;
//記事が格納されているフォルダーID(デフォルト:現在のフォルダー)。カンマ区切りで複数指定
// the folder that contains post entries. separate by commas to use multiple folders
$paginate = isset($paginate)? $paginate : 0;
//0:ページ送りを表示しない(デフォルト)、1:ページ送りを表示する
//以下ページ送りのサンプルコード
//<div id=”ditto_wrapper“>Page <strong></strong> of <strong></strong> Articles <div id="ditto_pages"> </div></div>
// paginatation enabled or disabled
$summarize = isset($summarize) ? $summarize : 3;
//一覧表示する投稿の数。これ以上はアーカイブリストに表示(デフォルト:3)
// number of posts of which to show a summary
// remainder (to total) go as an arhived/other posts list
$trunc = isset($trunc) ? $trunc : 1;
//0:本文の表示文字数制限をしない、1:する(デフォルト)
// should there be summary/short version of the posts?
$truncSplit = isset($truncSplit) ? $truncSplit : 1;
//0:任意の文字列までで区切らない、1:任意の文字列までで区切る(デフォルト)
// should the post be summarized at the "splitter"?
$truncAt = isset($truncAt) ? $truncAt : $_lang['default_splitter'];
//区切る任意の文字(デフォルト:<!-- splitter -->)
// where to split the text
$truncLen = isset($truncLen) ? $truncLen : 300;
//表示する本文の最大文字数(デフォルト:300)
// how many characters to show of blogs
$truncOffset = isset($truncOffset) ? $truncOffset : 30;
// how many characters to show of blogs
$truncText = isset($truncText)? $truncText : $_lang['more_text'];
//もっと読むの表示テキスト(デフォルト:Read more...)
// text to be displayed in item link
$truncChars = isset($truncChars) ? $truncChars : 0;
//0:HTMLタグを考慮しないで区切る、1:HTMLタグを考慮し区切る(デフォルト)
// truncate based on characters and not html tags
$tpl = isset($tpl) ? $modx->getChunk($tpl): $_lang['default_template'];
//テンプレートチャンク名
// optional user defined chunk name to format the summary posts
$showPublishedOnly = isset($showPublishedOnly) ? $showPublishedOnly : 1;
//0:非公開のみ表示、1:公開のみ表示(デフォルト)
// allows you to show unpublished docs if needed
$showInMenuOnly = isset($showInMenuOnly) ? $showInMenuOnly : 0;
//0:メニュー表示可のみ表示(デフォルト)、1:メニュー表示不可も表示
// allows you to show docs marked not to show in the menus
$emptyText = isset($emptyText)? $emptyText : $_lang['no_entries'];
//表示該当がない場合のテキスト(デフォルト:<p>No entries found.</p>)
// text to be displayed when there are no results
$dateFormat = isset($dateFormat)? $dateFormat : $_lang['date_format'];
//日付フォーマット(デフォルト:%d-%b-%y %H:%M)
// format for the summary post date format
$displayArchive = isset($displayArchive)? $displayArchive : 1;
//0:アーカイブを表示しない、1:表示する(デフォルト)
// whether or not to show the archive
$archiveText = isset($archiveText)? $archiveText : $_lang['archives'];
//アーカイブのテキスト(デフォルト:Archives)
// text to use for the Archives listing
$commentsChunk = isset($commentsChunk)? '' : '';
//コメント表示のチャンク名
// if you're using comments, the name of the chunk used to format them
$hiddenTVs = (isset($hiddenTVs))? $hiddenTVs : "" ;
// allows the snippet to filter by tv's not in the template. separate by comma.
$ditto->hiddenTVs = $hiddenTVs;
// send the variable to the class
$sortDir = isset($sortDir) ? strtoupper($sortDir) : 'DESC';
//ASC:昇順、DESC:降順(デフォルト)
// get sort dir
$sortBy = isset($sortBy) ? $ditto->checkSort($sortBy, $dateFormatType, $mode) : "createdon";
//`menuindex`でメニューの並び順、(デフォルト:作成日順)
// get sortBy
$hiddenTVs = $ditto->hiddenTVs;
// grab latest hiddenTV additions
$dateFormatType = $ditto->checkDateFormat($sortBy,$dateFormatType);
// date type to display (values can be createdon, pub_date, editedon)
if ($paginate == 1 && $_GET['start'] != 0) {
$start= isset($_GET['start'])? $_GET['start']: 0;
// get post # to start at
}else{
$start = isset($start) ? $start : 0;
// get start number
}
$debug = isset($debug)? $debug : 0;
//0:デバッグをしない(デフォルト)、1:デバッグする
// for testing odittoy
$archiveDateType = isset($archiveDateType) ? $archiveDateType : $dateFormatType;
// date type to display for archives (values can be createdon, pub_date, editedon)
$paginateAlwaysShowLinks = isset($paginateAlwaysShowLinks)? $paginateAlwaysShowLinks : 0;
//0:前へなどのリンクがない場合、リンクを表示しない(デフォルト)、1:常に表示する
// determine whether or not to always show previous next links
$paginateSplitterCharacter = isset($paginateSplitterCharacter)? $paginateSplitterCharacter : $_lang['button_splitter'];
// splitter to use of always show is disabled
$archivePlaceholder = isset($archivePlaceholder)? $archivePlaceholder : 0;
// output archive (older posts section) as a placeholder called
$filter = isset($filter)? $filter : false;
// odittoy show items meeting a criteria
// differant filters are | (pipe) delimited while each filter is comma delimited
// documentobjectortvwithtvprefix,criteria
$hideFolders = isset($hideFolders)? $hideFolders : 0;
//0:フォルダを表示する(デフォルト)、1:フォルダを表示しない
// don't show folders in the returned results
$descendentDepth = (isset($descendentDepth))? $descendentDepth : 10;
//ネストする階層を指定。(デフォルト:10)
// number of levels deep to go
$seeThruUnpub = (isset($seeThruUnpub))? $seeThruUnpub : 0 ;
// allows the snippet to see unpublished folders children
$format = (isset($format))? $format : "html" ;
//`rss`とするとRSS形式で出力。(デフォルト:html)
// tells the snippet whether to output html, archive, or rss

