前回に引き続き、
Articlesと日本語化
前回紹介したように、
また、
早速のバージョンアップ
2週間前に紹介したArticlesのバージョンは1.
Articles 1.4.7
- [#7069] Add articles.article_show_longtitle setting for toggling on/off the longtitle field when editing Articles
- [#7057] Fix issue with RTEs and updating an Article
Articles 1.4.6
- Fix issue with Articles snippet and $this reference
Articles 1.4.5
- [#6832],[#6697],[#6596] Remove 255 char limit from Article summary field, remove 100 char tags field limit
Articles 1.4.4
- [#6641] Add option to turn off richtext editing for Articles in a Container
- [#6897] Add offset as option to latest posts display
- [#6639] Add option to change default sorting for Articles in mgr container grid
- [#7001] Fix issue where disabling comments prevented other placeholders from displaying
- [#6980] Fix issue with fallback Twitter feed tpl
- [#6850] Enable multiple Articles snippet calls per page
- [#6625] Add in longtitle for Container in General Settings
- Fix issue where changing template settings did not activate save btn
- Add German, Russian, Czech translations
- [#6626] Improve pub-date checking on WordPress import
- [#6601] Fix template variables tab showing when creating a new article
- [#6966] Fix issue with non-web contexts - Update Quip to 2.2.0-pl
Articlesにおけるリソースの構成
前回は、
以前、
結論から言ってしまえば、
mysql=> select id,published,hidemenu,pagetitle from modx_site_content; +----+-----------+----------+-----------------------+ | id | published | hidemenu | pagetitle | +----+-----------+----------+-----------------------+ | 1 | 1 | 0 | トップ | | 2 | 1 | 0 | 会社情報 | | 3 | 1 | 0 | 商品紹介 | | 4 | 1 | 0 | お茶 | | 5 | 1 | 0 | ギフト | | 6 | 1 | 0 | 生姜紅茶 | | 7 | 1 | 1 | 検索結果 | | 8 | 1 | 0 | 秘密のフォルダ | | 9 | 0 | 0 | ログイン | | 11 | 1 | 0 | 秘密2 | | 10 | 1 | 0 | 秘密1 | | 12 | 0 | 0 | 秘密のページ | | 14 | 1 | 0 | お問い合わせ | | 18 | 1 | 1 | スレッドに返信 | | 22 | 1 | 0 | 松の露 | | 27 | 1 | 1 | 同窓会 | | 28 | 1 | 1 | テレビ欲しい | | 26 | 1 | 0 | ブログ | +----+-----------+----------+-----------------------+
Articles上の記事だけを検索するためには、
mysql=> select id,published,hidemenu,pagetitle from modx_site_content where class_key = 'Article'; +----+-----------+----------+--------------------+ | id | published | hidemenu | pagetitle | +----+-----------+----------+--------------------+ | 27 | 1 | 1 | 同窓会 | | 28 | 1 | 1 | テレビ欲しい | +----+-----------+----------+--------------------+
Articlesを導入したことで、 class_
SimpleSearchの設置
MODxに検索機能を設けるためのスニペット、
以前の記事をもう一度読み返してみてください。SimpleSearchを使用するためには以下の手順を行う必要がありました。
- 検索フォームを設置するページで[[!SimpleSearchForm? オプション...]]という記述を行い
- 検索結果を表示させるページでは[[!SimpleSearch? オプション...]]という記述を行う
ということで、
<form id="quick-search" action="search-results.html" method="get">
<p>
<label for="qsearch">Search:</label>
<input class="tbox" id="qsearch" type="text" name="search" value="" title="Start typing and hit ENTER" />
<input class="btn" alt="Search" type="image" title="Search" src="[[++articles.assets_url:default=`assets/components/articles/`]]themes/default/images/search.gif" />
</p>
</form>
ページの都合上
上記のフォーム部分を次のように置き換えます。
<br /><br /><br />
[[!SimpleSearchForm? &landing=`32` &tpl=`my_search`]]
my_
<script type="text/javascript">
<!--
function erase_words(obj){
if(obj.value==obj.defaultValue){
obj.value="";
obj.style.color="#000";
}
}
function put_words(obj){
if(obj.value==""){
obj.value=obj.defaultValue;
obj.style.color="#999";
}
}
//-->
</script>
<form action="[[~[[+landing]]]]" method="[[+method]]">
<input type="text" id="keywords4" name="[[+searchIndex]]" value="検索キーワードを入力" size="20" onFocus="erase_words(this)" onBlur="put_words(this)" style="color: #999;"/>
<input type="hidden" name="id" value="[[+landing]]" />
</form>
次に、
ざっと調べてみたところ、
リソースID | 32 |
---|---|
タイトル | ブログ検索結果 |
使用テンプレート | sample. |
エイリアス | blog-search-result |
メニューに表示しない | チェック |
公開する | チェック |
コンテンツ | <p>[[!SimpleSearch? &highlightResults=`0` &hideMenu=`1`?]]</p> |
終わりに
前回からの繰り返しになりますが、