以前好像有看過有人分享過,但是剛剛搜尋又沒找到,所以我就貼出來啦,若是重複了再麻煩站長刪掉囉
改完之後,就可以直接在系統管理介面修改歡迎訊息,不需要去動 locale file
1. 修改 templates/admin/globalsettings_summary.template,在適當處加上
<!-- welcome_title -->
<div class="field">
<label for="config[welcome_title]">welcome_title</label>
<div class="formHelp">{$locale->tr("help_welcome_title")}</div>
<input style="width:100%" type="text" name="config[welcome_title]" id="config[welcome_title]" value="{$welcome_title}"/>
</div>
<!-- welcome_paragraph -->
<div class="field">
<label for="config[welcome_paragraph]">welcome_paragraph</label>
<div class="formHelp">{$locale->tr("help_welcome_paragraph")}</div>
<textarea name="config[welcome_paragraph]" cols="100" rows="5">{$welcome_paragraph}</textarea>
</div>
2. 修改 class/summary/action/summarydefaultaction.class.php,在perform()中加上
$this->_view->setValue( "welcome_title", $this->_config->getValue( "welcome_title" ));
$this->_view->setValue( "welcome_paragraph", $this->_config->getValue( "welcome_paragraph" ));
3. 修改 templates/summary/index.template,將原本是從locale設定的訊息改掉
<div id="intro">
<h4>{$welcome_title}</h4>
{$welcome_paragraph}
</div>