I have created model in DXA

namespace Sdl.Web.Web.Common.Models
    public class Test:EntityModel
        public Tag Test{ get; set; }

I'm able to get the Keyword key @Model.Test.Key but to get keyword name I tried for accessing Keyword Name but didn't find it.

Please let me know how to get the Keyword Name in DXA

  • Note that namespace Sdl.Web.Common.Models is intended for View Models provided as part of the DXA Framework. It is not recommended to define your own View Models in that namespace. – Rick Pannekoek Dec 27 '16 at 13:56

Class Tag has a DisplayText property which reflects the Keyword's Description or Title (if Description is not set).

In DXA 1.7 a new (base) class KeywordModel has been introduced, which provides direct access to all Keyword properties.

Seeing that you are still on a relatively ancient version of DXA, I would recommend upgrading to the latest. Unfortunately, DXA 1.7 does not support 2013 SP1.

| improve this answer | |
  • thanks , using DisplayText able to get the keyword desciption – k951 Dec 27 '16 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.