Forum Discussion

peterlu's avatar
peterlu
Champion
10 years ago

custom post / message meta data on certain node(s)

We all know that professional service team can help set up custom meta data for messages.

Lets say we have 3 forum boards, and we only want to set up custom meta data for messages on 2 boards.

Is it possible?

 

If not, what is the workaround?

Use freemarker to detect the 2 boards, and use css to show the meta data input fields?

 

What if the meta data input fields are compulsory at frontend? Does that mean we have to write Javascript to validate the field before the form gets posted?

 

Open to suggestions.

  • Hi peterlu 

     

    I assume that you want to add two metadata fields to blogA and blogB, but not all blogs.

     

    It can only be done via Professional Services. basically, we will 

    1) add metadata to the message node, specify that it is for blog and root-only (no reply)

    2) change message post form layout to include those two fields

     

    after that, non blog articles will not be blocked as the metadata is for blog only. but all blogs, will have two additional fields, so we have to 

     

    3) add some java class, which will check the node id and exclude the two fields in the form layout before post page loads. In another words, we can hide the two additional fields from server side, without CSS or JS.

     

    I hope that the above explaination helps.

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)

    Hi peterlu 

     

    I assume that you want to add two metadata fields to blogA and blogB, but not all blogs.

     

    It can only be done via Professional Services. basically, we will 

    1) add metadata to the message node, specify that it is for blog and root-only (no reply)

    2) change message post form layout to include those two fields

     

    after that, non blog articles will not be blocked as the metadata is for blog only. but all blogs, will have two additional fields, so we have to 

     

    3) add some java class, which will check the node id and exclude the two fields in the form layout before post page loads. In another words, we can hide the two additional fields from server side, without CSS or JS.

     

    I hope that the above explaination helps.

    • peterlu's avatar
      peterlu
      Champion

      Thanks, @HaidongG, that is magic. Glad that it is possible at backend.

      One more question, if the meta fields are compulsory by meta configuration, for those boards that do not have these meta (eg.blogC), when a user post a message into blogC on PostPage, will it throws errors? (since meta configuration says it is compulsory, and the meta is not installed on blogC, only on blogA and blogB.)

       

      • HaidongG's avatar
        HaidongG
        Lithium Alumni (Retired)

        Hi peterlu 

         

        None, there won't be any exception for BlogC. There is no such field and therefore there is no validation against that field.