1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then 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.

Expression to show widget on item page

Discussion in 'Showcase Support' started by NinaMcI, Jan 29, 2016.

  1. NinaMcI

    NinaMcI Member Showcase

    Hi,
    I can't work out what expression to use in order to display a widget on a particular showcase item page.
    Any help would be gratefully appreciated.
    Thanks
     
  2. Bob

    Bob Developer Staff Member

    What function are you using? There are so many different ways of doing things, I need you to be more specific. Maybe screen shot the function you are wanting to use.

    The BEST way (IMO) is to use the HOOK method. You edit the showcase item template and add a Custom HOOK (just a simple line of code) at the exact location you want to display the widget and then create the widget and tell it to use the Custom HOOK.
     
  3. NinaMcI

    NinaMcI Member Showcase

    Hi Bob,
    I'm using the widget framework. I've entered the hook position, hook:showcase_item_private_controls which works fine.
    What I'd like to know is how can I display this widget on a specific item page only (item id 126)?
     
  4. Bob

    Bob Developer Staff Member

    Im not sure that is possible. The only way I can think of is to TRY (not tested) adding your OWN hook so that you can wrap the hook with a conditional (checking the item id) so that the hook is only exposed for that item. Again, UNTESTED and I am not sure that would even work (depending on how xfrocks is checking for hook locations). If its possible to check a discussion thread ID, then its possible to check a showcase item ID.
     
  5. NinaMcI

    NinaMcI Member Showcase

    Hi,
    I've managed to it using
    Code:
    in_array($item['item_id'], array(126))
     
    tajhay and Bob like this.
  6. Bob

    Bob Developer Staff Member

    right on! :)
     
  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.