Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.

Commit bfd263e

Browse files
authored
Update readme.md
1 parent 449a96b commit bfd263e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,16 @@ By default, BlockListMvc will look for your block item views in Views/Partials/B
7474
The block view is then created like you are used to.
7575

7676
BlockListMvc comes with its own [ViewPage called `BlockListItemViewPage`](https://github.com/skttl/umbraco-blocklistmvc/blob/master/src/Our.Umbraco.BlockListMvc/Mvc/BlockListItemViewPage.cs) which inherits `UmbracoViewPage` and adds a BlockContext property, from which you can get [contextual information](https://github.com/skttl/umbraco-blocklistmvc/blob/master/src/Our.Umbraco.BlockListMvc/Models/BlockListItemContext.cs) like the list the block belongs too, and whether the block is the first/last in the list etc.
77+
78+
Example:
79+
80+
```cshtml
81+
@using Umbraco.Core.Models.Blocks
82+
@using Our.Umbraco.BlockListMvc.Mvc
83+
@inherits BlockListItemViewPage<BlockListItem<Feature>>
84+
85+
<div class="@(BlockContext.IsFirst == false ? "mt-4" : "")">
86+
<h2>@Model.Content.FeatureName</h2>
87+
<p>@Model.Content.FeatureDetails</p>
88+
</div>
89+
```

0 commit comments

Comments
 (0)