Editing a block list title

By | July 31, 2012

In my previous post I had explained, how we can change the title of the list block at runtime. Here is the link.
In this blog post I will explain how block titles can be handled through code and how they can be used to configure the hidden variables to be used for customization.
Suppose you want to give title to block designed using standard build in COM API. This can be easily achieved using below syntax.
var SearchContainer = eWare.GetBlock(‘YourBlockName‘);
SearchContainer.Title=”New ListBlock”;
You can even configure the Block title in the Translations and then access the same to be used with above syntax.  Code changes as below using GetTrans method.
var SearchContainer = eWare.GetBlock(‘YourBlockName‘);
SearchContainer.Title = eWare.GetTrans(“Tabnames”,”Search”);
Now how do you create hidden field using Title functionality? Below is the code you can use.
var SearchContainer = eWare.GetBlock(‘YourBlockName‘);
SearchContainer.Title = eWare.GetTrans(“Tabnames”,”Search”)+”<input type=hidden name=hdnSave>”;