1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved Condition to display widget in certain article category

Discussion in 'AMS Support' started by CHAIM2003, Sep 19, 2021.

  1. CHAIM2003

    CHAIM2003 New Member AMS

    Hello :)
    I'd like to display a widget in a certain article category.
    What should the condition look like?

    Thanks!!
     
  2. Bob

    Bob Developer Staff Member

    For displaying in a single category...

    Note
    : change 1 to the specific category ID that you want the widget to be displayed in
    Code:
    $xf.reply.containerKey == 'amsCategory-1'

    For displaying in multiple category's...
    Code:
    in_array($xf.reply.containerKey, ['amsCategory-1', 'amsCategory-2', 'amsCategory-4'])

    Example... here I am telling the widget to only display on AMS Category 1 (News).

    Selection_075.png


    And here you can see it displaying in the News Category Sidenav

    Selection_076.png
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.