Skip to content

Commit 91af526

Browse files
author
Warren Buckley
committed
Update readme
1 parent 3dfbe49 commit 91af526

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,18 @@ It can be used in one of two ways, either by specifying the `src` attribute to a
187187
<our-svg media-item="@Model.Logo" />
188188
```
189189

190+
## `<our-fallback>`
191+
This tag helper element `<our-fallback>` uses the same fallback mode logic that is only available on the `Value()` method of the `IPublishedContent` interface that uses a string for the property name to lookup. In addition if the fallback value from a language or ancestors is not available we are still able to fallback to the content inside the tag.
192+
193+
```cshtml
194+
@* Current way *@
195+
@Model.Value("Header", fallback:Fallback.ToLanguage)
196+
197+
<h3><our-fallback property="Header" mode="Fallback.ToLanguage" culture="da-DK">I do NOT have a DK culture variant of this property</our-fallback></h3>
198+
<h3><our-fallback property="Header" mode="Fallback.ToAncestors">I do NOT have a Header property set on ANY parent and ancestors</our-fallback></h3>
199+
```
200+
201+
190202
## Video 📺
191203
[![How to create ASP.NET TagHelpers for Umbraco](https://user-images.githubusercontent.com/1389894/138666925-15475216-239f-439d-b989-c67995e5df71.png)](https://www.youtube.com/watch?v=3fkDs0NwIE8)
192204

0 commit comments

Comments
 (0)