Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vinod 22 posts 83 karma points
    May 22, 2015 @ 12:39
    Vinod
    0

    Implement Tag Cloud and Unique Name Validation in umbraco 7.2.5

    Hi,

    I am developing web application in Umbraco 7.2.5 and MVC. Can you please help me on implementing the below requiements inside umbraco. 

    • Implementing Tag Cloud inside umbraco by adding as a datatype
    • Category Name - Unique Validation 
    Regarding second point, my requirement is if admin enters the existing Category Name and tries to publish he should get a validation message and publish shouldn't happen.I think Unique Validation is not available by default in Umbraco 7. If the entered Category name is already available Umbraco Appends (1) to it like Samsung and Samsung (1). After analysis I found a way but I am facing some issue in that too. Can you please help.
    • Validating the name in the Before Save Event. The problem with this approach is umbraco displays some generic message "Publish was cancelled by a third-party plugin" , which Admin won’t understand the exact reason. I tried customizing but couldn’t succeed. Is there any way I could customize the message. Below is the code i tried. 
          
     protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
            {
                ContentService.Saving += ValidateName;
            }
            private void ValidateName(IContentService sender, Umbraco.Core.Events.SaveEventArgs e)
            {
               .....
                if (nameAlreadyExists)
                {
                   e.Cancel = true; 
     e.Cancel = true; BasePage.Current.ClientTools.ShowSpeechBubble(BasePage.speechBubbleIcon.error, "error", "Already Exists");
                }
            }
    

    Is there any event in javascript to fire when Publishing is performed.

Please Sign in or register to post replies

Write your reply to:

Draft