1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

template conditionals inside xen:checkboxunit

Discussion in 'XenForo Development Discussions' started by Jake B., Feb 3, 2015.

  1. Jake B.

    Jake B. Well-Known Member

    I'm needing to wrap one of the options in my checkbox unit with a conditional (so that it only displays if certain conditions are met). When I tried using the xen:if conditional around the option I got a message stating:
    "Unknown tag: option"

    If this isn't possible I can of course create the ctrlUnit and inputs manually, but I'd prefer to leave that to XenForo if possible.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Try:

    Code:
    <xen:option value="value" displayif="{$foo} == 'bar'" />
     
    SneakyDave likes this.
  3. Jake B.

    Jake B. Well-Known Member

    Once again, worked perfectly. Thanks! Had no idea this parameter existed.
     
    SneakyDave likes this.
  4. Jake B.

    Jake B. Well-Known Member

    @Chris D any chance there is something like this for xen:breadcrumb? I've tried using displayif, and it doesn't seem to be a valid parameter, and i cannot use xen:if inside xen:navigation. I'd rather not have two instances of xen:navigation in my template if there is another option :)
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    Prepare your breadcrumbs in PHP and pass them to the template e.g. <xen:breadcrumbs source="{$breadcrumbs}" />
     

Share This Page