From f184b8d15cd83de24db6aff06762c0e59fb1c1a2 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Thu, 28 Oct 2021 09:10:26 +0100 Subject: [PATCH] Update readme with example of our-member-include & exclude --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 7e379da..02ef2f4 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,24 @@ This tag helper element `` prints out version number for a given As ``` +## `our-member-include` and `our-member-exclude` +This is a tag helper attribute that can be applied to any DOM element in the razor template or partial. It will show or hide its element and children on the page when passing a comma seperated string of member groups that the current logged in member for the exclude or include variants. + +There are two special Member Groups you can use: +* `*` - All anonymous users +* `?` - All authenticated users + +```cshtml +
Only members of Staff Member Group will see this.
+
Only members of Staff OR Admins member group will see this.
+
Only logged in members will see this.
+
Only anonymous members will see this.
+ +
Only Staff members can't see this (Including anonymous).
+
Everyone except Anonymous members will see this.
+
Everyone except who is authenticated will see this.
+``` + ## Video 📺 [![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)