Forum Discussion

ebonifacio's avatar
3 years ago

Get ID from a board's category

Hello

I'm trying to add a component to some boards, but I need to add from specific category.

How do I get the category ID from these boards? so I can make my condition.

 

 

2 Replies

  • VikasB's avatar
    VikasB
    Boss
    3 years ago

    djondinium 
    coreNode.id will return the board id if you are on a board page or message/article page. 

    ebonifacio 
    Here you can check how you can apply category conttraint in the quries

    For Root

     

    select * from boards WHERE root_category.id = 'ABC'

     

     

     For Parent

     

    select * from boards WHERE parent_category.id = 'ABC'

     

     

    For mutiple categories 

     

    select * from boards WHERE root_category.id IN ('ABC', 'XYZ')