GithubHelp home page GithubHelp logo

nikrimington / super-value-converters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from callumbwhyte/super-value-converters

0.0 1.0 0.0 328 KB

A collection of powerful property value converters for cleaner code in Umbraco

License: MIT License

C# 100.00%

super-value-converters's Introduction

Umbraco SuperValueConverters

Umbraco SuperValueConverters

NuGet release Our Umbraco project page

Looking for SuperValueConverters for Umbraco 8? Check the v8/dev branch.

SuperValueConverters is a collection of powerful property value converters for Umbraco, eliminating the need for casting and null checks on Umbraco picker values in views or controllers and helping to keep code cleaner.

Getting started

SuperValueConverters is supported on Umbraco 9.

Once installed you don't need to do anything to activate SuperValueConverters.

Installation

SuperValueConverters is available from Our Umbraco, NuGet, or as a manual download directly from GitHub.

Our Umbraco repository

You can find a downloadable package, along with a discussion forum for this package, on the Our Umbraco site.

NuGet package repository

To install from NuGet, run the following command in your instance of Visual Studio.

PM> Install-Package Our.Umbraco.SuperValueConverters

Usage

Where a picker that returns multiple items (such as MNTP or Nested Content) has been configured to only allow a single item to be selected (via it's "maxItems" setting), the returned value will now be a single IPublishedContent rather than IEnumerable<IPublishedContent>.

Supported value converters will no longer return null if no value has been picked - an empty collection will be returned instead, preventing the need for null checks.

Currently the following datatypes are supported:

  • Multi-Node Tree Picker
  • Nested Content

Models Builder

SuperValueConverters works seamlessly with Models Builder (if you're using it) to return the correct model types from pickers rather than IPublishedContent.

Where a picker has been configured to only allow items of a specific doctype, the returned value will be already cast to the relevant Models Builder generated model.

In cases where an allowed doctype uses compositions Models Builder will generate an interface for that model. If more than one allowed doctype on a given picker implements the same interface, the returned value will be cast to the shared interface rather than the default IPublishedContent.

Contribution guidelines

To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the library.

Who do I talk to?

This project is maintained by Callum Whyte and contributors. If you have any questions about the project please get in touch on Twitter, or by raising an issue on GitHub.

Credits

The logo uses the Energy icon from the Noun Project by Scarlett McKay, licensed under CC BY 3.0 US.

A special #h5yr to our contributors

License

Copyright © 2022 Callum Whyte, and other contributors

Licensed under the MIT License.

super-value-converters's People

Contributors

callumbwhyte avatar robertjf avatar leekelleher avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.