Forum Discussion

HaikuBT's avatar
HaikuBT
Adept
13 years ago

Board-dependent custom component

Hello,

 

I'd like to create a custom component that would be board dependent. For instance, if you're in Forum A, the custom component would perform Function X, if you're in Forum B, the custom component would perform Function Y.

 

Thanks for whatever help anyone can provide.

 

Bonnie

  • KaelaC's avatar
    KaelaC
    Lithium Alumni (Retired)

    Are you going to know the board ids of these board or should it be dynamic?  If you are hand selecting boards you can put in some code that says

     

    <#if coreNode.id == "board A">
     <#-- Do function X -->
    <#elseif coreNode.id == "board B">
     <#-- Do function Y -->
    </#if>
    

     

     

    If the two functions are completely different, I would suggest creating two components instead of one. It's a good idea to keep a component to a single purpose for maintenance later.