Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the ExtendedMediaPicker #12

Closed
kipusoep opened this issue Jan 12, 2016 · 2 comments
Closed

Include the ExtendedMediaPicker #12

kipusoep opened this issue Jan 12, 2016 · 2 comments

Comments

@kipusoep
Copy link

Hi, great package!

Could you include the ExtendedMediaPicker inside the MediaPropertyValueConverter too please?

@Jeavon
Copy link
Owner

Jeavon commented Jan 13, 2016

Thanks, ExtendedMediaPicker isn't a "Core" editor so it wouldn't belong in this package. However it is extremely easy to implement like below:

namespace MyProjectNameSpace
{
    using Our.Umbraco.PropertyConverters;
    using Umbraco.Core.Models.PublishedContent;

    public class ExtendedMediaPickerPropertyConverter : MultipleMediaPickerPropertyConverter
    {
        /// <summary>
        /// Reuses the <see cref="Our.Umbraco.PropertyConverters.MultipleMediaPickerPropertyConverter"/> for CTH.ExtendedMediaPicker
        /// </summary>
        /// <param name="propertyType">The Umbraco property type to convert</param>
        /// <returns>A value indicating whether this converter can convert the value</returns>
        public override bool IsConverter(PublishedPropertyType propertyType)
        {
            return propertyType.PropertyEditorAlias.Equals("CTH.ExtendedMediaPicker");
        }
    }
}

Either ExtendedMediaPicker should include the converter itself or I suppose we could create a "addon" package for the Core Value Converters for community editors such as this one.......?????

@kipusoep
Copy link
Author

That's a really nice solution indeed, thanks!
I guess you're right about not being a Core property editor and if it's this easy to add a new property editor alias to an existing converter I suggest to not bother at all :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants