This project is read-only.

Change name of Web part variable.

Topics: Customizing Orchard, Writing modules
Apr 12, 2013 at 3:49 PM
I have functionality in which I need to add text box which will be shown as Title for page's body. To achieve this I have created one web part and declare one string variable as BTitle. When I have added this web part into my page content type, it is showing text box with BTitle lable to it. Now I want to change BTitle name to "Body Title". How can I achieve this.

I tried below changes in Model but it is not working.
[Display(Name="Body Title")]
    public string BTitle
        get { return Record.BTitle; }
        set { Record.BTitle = value; }
Apr 12, 2013 at 11:47 PM
Edited Apr 12, 2013 at 11:47 PM
By web part, do you mean content part?
If so, you will most likely have created an editor template. From there, you can render any title you want.
The DisplayAttribute should work when you use Html.EditorFor<T>, but I recommend using Orchard's T localizer (e.g. @T("Body Title")).
Apr 13, 2013 at 10:01 AM
Thanks a lot. I am able to resolve issue using Orchard's T localizer.

At first I got error as "T does not exist", but I made changes in .webconfig file as per suggestion given in "" and it works.