Forum Discussion

Beryllium's avatar
12 years ago

Where do you define macros?

I thought I read somewhere where macro's are suitable to be defined in lithium but I could not find it in the studio documentaiton. Can someone tell me?

 

Wrappers seems like the wrong place because I may want to use macro's across themes too. 

6 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    Hi,

     

    what you can do is to define your macros in a custom component (or more than one if you want to group them in a specific way) and then include that component when you need it. For example, say you have your macros defined in a component called common-macros , then you can simply include it from other components using the directive

     

    <#include "common-macros.ftl">

     

    And you will be able to use the macros when you need them in your components.

     

    Thanks,

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    In addition to what Paolo mentioned, there's also a "Macros" feature in Studio. To create a Macro:

    1. Browse to Studio
    2. Select the "Endpoints" tab
    3. Click the "New Macro"
    4. Enter a title and then save.

    Macros will appear in the "Macros" section below the "Endpoints" section in the left column. From there you can view, edit, or delete existing macros. The benefit of a macro is that it can be included not only in other custom components, but also in endpoints as well. So macros are great for code that you want to share to endpoints as well.

     

    If you don't see the "Endpoints" tab in Studio, please contact Support via the customer case portal so they can enable it for you.

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    12 years ago

    If Endpoints were enabled, you’d see the tab between the Features and Versions tab.

    enpointTab.jpg

     

  • "You do not have access to manage or submit cases.

    If you believe you received this message in error, please email support@lithium.com. Be sure to include your Lithosphere username and note this error message"

    well, I guess I'll have to contact more people