Forum Discussion

shhouji's avatar
shhouji
Mentor
9 years ago

How to pragmatically add Labels while creating new article?

In TKB article editor page, programatically we want to add some pre-defined Labels to a new article that is to be created.

 

This TKB article editor page has label text box where user can add Labels manually by selecting label from labels tree. Currently, on submit, Lithium is adding these selected labels to newly created article.

 

But we need a way (programatically) to add some predefined labels (selected dynamically), lets say, the label "Administration" from Activity category in labels tree, along with user selected labels and display them in the label text box. On submit, these predifined labels along with user selected labels should be added to the newly created article.

 

Could any one please let us know how this can be achieved?