I have added two more columns to the view.The problem is that,it is showing these columns for all the views.I referred [Add listDefinition/Columns only to specific folder and figured it can be restricted to specific items(in my case only for components and pages.Probably on click of folders and structured groups). I am not getting clarity on how to go about doing that. Can anyone help me out? Thanks in advance!
I got the solution.
listdefinition idmatch="^tcm:\d+-\d+-2$ | ^tcm:\d+-\d+-4$" url="/ListDefinitions/YouListDefinitionXml.xml"
- ^tcm:\d+-\d+-2$ --> On click of Folders in the CME my newly added columns will be shown
^tcm:\d+-\d+-4$ --> On click of SGs in the CME my newly added columns will be shown. (All the items whose parent item id matches the rule mentioned in idmatch, the columns will be shown. As components are usually in a folder and pages in SG I have used this rule) Hence restricting it to only components and pages. Purpose served.
In YouListDefinitionXml.Xml define the new columns along with the once avaliable in \tridion\web\WebUI\Editors\CME\Xml\ListDefinitions\ListItems.xml.
@Thomas Hendrickx - thank you for your suggestion and your earlier post Add listDefinition/Columns only to specific folder