1

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

1
  • 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. Commented Dec 27, 2016 at 13:56

1 Answer 1

1

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.

1
  • thanks , using DisplayText able to get the keyword desciption
    – k951
    Commented Dec 27, 2016 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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