0
ブレッドクラムのためのumbraco backofficeに部分ビューマクロファイルを作成しました。マクロをmasterPageに挿入してサイトを実行しましたが、何も見えませんでした。ブレッドクラムのナビゲーション、エラー、jsut何もない。何が間違っていますか?Umbracoサイトでブレッドクラムが表示されない
私を助けてください
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@*
This snippet makes a breadcrumb of parents using an unordered html list.
How it works:
- It uses the Ancestors() method to get all parents and then generates links so the visitor can go back
- Finally it outputs the name of the current page (without a link)
*@
@{ var selection = CurrentPage.Ancestors(); }
@if (selection.Any())
{
<ul class="breadcrumb">
@* For each page in the ancestors collection which have been ordered by Level (so we start with the highest top node first) *@
@foreach (var item in selection.OrderBy("Level"))
{
<li><a href="@item.Url">@item.Name</a> <span class="divider">/</span></li>
}
@* Display the current page as the last item in the list *@
<li class="active">@CurrentPage.Name</li>
</ul>
}
以下ブレッドクラムコードを参照してください。ありがとう。その下の
masterページを使用する子ページを作成しましたか?また、 'var selection = ...'にブレークポイントを設定してデバッグすると、選択のために何かが見えるのですか、それともこのヌルですか? – Mivaweb
これは、子ページにはメインページが表示されず、ホームページには何も表示されませんが、ホームページには「祖先」ページがないため、ホームページの下に表示されます。 –
@denfordmutseriwaあまりにもあなたの応答をありがとう。マスターページを継承したすべてのページに表示する必要があります。それをどうやって正しい方向に向けることができますか? –