AndyButland / UmbracoPersonalisationGroups

Package for personalisation of content with Umbraco.
MIT License
38 stars 18 forks source link

Additional Extensions : Custom groups #6

Closed KevinJump closed 7 years ago

KevinJump commented 7 years ago

Adding a generic extra extension method, where you can pass in the list of group Ids.

This involves changing the main extension method to take a list of groups in then creating a stub extension method to maintain the existing functionality, and a new UmbracoHelper Extension method, that takes a list of integer values - and uses them as the personalization group ids.

Then we can pass in our own set of personalization groups. This enables us to get the groups from other properties, or child items.

In our specific example, we are using LeBlender to create custom Grid Editors, and adding the Personalization Group Picker to the editor. At render time, we are getting the groups from the value in the editor and passing it to the new generic extension method Umbraco.ShowToVisitor(groupIds). This means we can then have personalized blocks on our grid layout.

AndyButland commented 7 years ago

Thanks for this Kevin, nice idea. I'll hopefully to get to pulling this in this evening.