ソースを書いてみました。
http://gist.github.com/acliss19xx/6053137
リンク先のように変更すれば
ページ名(説明文)と出ます。
2行で表示するにはどうするんでしょう?だれかヘルプお願いします。
Re: ナビ項目に説明を追加できないでしょうか
2013年7月22日 at 12:08
すみません。 2回目のforeachの内です
119行目でhtml作成していますのでそこのあたりです。
タグ:
Re: ナビ項目に説明を追加できないでしょうか
2013年7月23日 at 6:45
以下のように<br />を挟む変更すれば、2行になります。
変更前: echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '(' . $ni->cObj->getCollectionDescription() . ')</a>';
変更後: echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '<br />(' . $ni->cObj->getCollectionDescription() . ')</a>';
すみません。私のはもう要りませんね。
変更前: echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '(' . $ni->cObj->getCollectionDescription() . ')</a>';
変更後: echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '<br />(' . $ni->cObj->getCollectionDescription() . ')</a>';
すみません。私のはもう要りませんね。
Your post has been saved and will be published after approval by the forum moderator.
xark
Re: ナビ項目に説明を追加できないでしょうか
115行目から
foreach ($navItems as $ni) {
echo '<li class="' . $ni->classes . '">'; //opens a nav item
echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>';
if ($ni->hasSubmenu) {
echo '<ul>'; //opens a dropdown sub-menu
} else {
echo '</li>'; //closes a nav item
echo str_repeat('</ul></li>', $ni->subDepth); //closes dropdown sub-menu(s) and their top-level nav item(s)
}
となっていますが、どうすれば良いでしょうか。