Forum Discussion

clemlith's avatar
clemlith
Expert
11 years ago

Knowing if a custom content is empty or not

Hi Everyone,

I love custom content because they allow me to push something live without having to go through studio and doing a studio push.

 

I wondering if there is a way to know if a custom content is filled with content or not ?

Ideally this test would be available at every node level.

 

If you have the answer please share it with me :)

 

Best,

Clement

 

 

  • Hi clemlith 

     

    I am assuming you are asking for a way to do this programmatically - as the Admin section will tell you if the element has content at that level of the community structure.

     

    If I am correct, then you may want to have a look at this TKB article that explains how you can retrieve the custom content (or test for the absence of it) using the REST API.

     

    I hope this helps!

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)

    Hi clemlith 

     

    I am assuming you are asking for a way to do this programmatically - as the Admin section will tell you if the element has content at that level of the community structure.

     

    If I am correct, then you may want to have a look at this TKB article that explains how you can retrieve the custom content (or test for the absence of it) using the REST API.

     

    I hope this helps!

    • clemlith's avatar
      clemlith
      Expert

      Hi PaoloT ,

      Thanks, This was exactly what I was looking for !

      I would have been very nice if a freemarker directive(or somthing else) existed in order to get automatically the content of the custom content on the current node.

      iftomkinsDid you find the answer to the question you were raising in the comment of the TKB article mentioned by Paolo ?

       

      Best,

      Clement

      • iftomkins's avatar
        iftomkins
        Maven

        clemlith I did eventually find a solution that works in most situations. There are still times when it's difficult to create conditionals based on where the user is (such as if an idea board and a forum board have the same exact id, which is possible). I was provided with a snippet and explanation in this thread, which will hopefully help.