Copied to clipboard

Flag this post as spam?

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


  • Mangirish Wagle 34 posts 106 karma points
    Jan 04, 2017 @ 07:50
    Mangirish Wagle
    0

    Calling Property values and Multilingual Vorto Values in Model

    Hello All,

    I am stuck in how to call Umbraco Property Values or more specifically Vorto values inside a Model. I am having this RegularExpression with an ErrorMessage

    [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage ="Invalid Email" )]
    

    Just needed to know as to how to call Umbraco Vorto Values and Property values. In .cshtml view files I use this method....

     @{ 
         var page = Umbraco.Content(node_id);
         IPublishedContent pageContent = (IPublishedContent)page ;
         var pageTitle = @pageContent.GetVortoValue("pageTitle");
      }
      <p>@pageTitle</p>
    

    Where, of course @pageTitle is the property value (VortoValue in specific). So, which is the best method to call property values and vorto values inside a Model. Specially in ErrorMessage section in RegularExpression directive in a Model.

    Please suggest me.

    Regards,

    Mangirish

Please Sign in or register to post replies

Write your reply to:

Draft