Skip to content

Commit 190a107

Browse files
author
Warren Buckley
committed
Update readme with NEW tag
1 parent fc3ad7b commit 190a107

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,25 @@ Alternatively you can use the `our-active-class` attribute in conjuction with `o
319319
</ul>
320320
```
321321

322+
## `<our-link>`
323+
This tag helper element `<our-link>` will create a simple anchor tag using the Umbraco Multi Url Picker property editor that uses the C# Model `Umbraco.Cms.Core.Models.Link`
324+
325+
Note if the link set is an external link and you set the target of the link to be `_blank`, then the link will have the noopener attribute added to the link.
326+
327+
### Simple Example
328+
```cshtml
329+
<our-link="@Model.ctaLink">
330+
<h2>Hi There</h2>
331+
</our-link>
332+
```
333+
334+
Alternatively if you use the `<our-link>` without child DOM elements then it will use the `Title` property of the link in the Multi Url Picker property editor to create the anchor tag.
335+
336+
```cshtml
337+
<our-link="@Model.ctaLink"></our-link>
338+
```
339+
340+
With this tag helper the child DOM elements inside the `<our-link>` is wrapped with the `<a>` tag
322341

323342
## Video 📺
324343
[![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)

0 commit comments

Comments
 (0)