v:else doesn't render when using custom tags
  • Hi guys,

    I've created a custom PHP function in __vae.php:
    function check_device($a, $tag, $context, &$callback) {
    $detect = new Mobile_Detect();
    $device = ($detect->isMobile() || $detect->isTablet()) ? 'mobile' : 'desktop';
    return vae_render_tags($tag, $context, ($a['device'] == $device));

    vae_register_tag('check_device', array(
    'handler' => 'check_device',
    'params' => array("device"),
    'required' => array("device")

    I use this syntax:
    <v:check_device device="mobile">
    User is on mobile
    <v:else>User is on desktop</v:else>

    For some reason the content of v:else won't render when the php-function returns false. Am I doing something wrong here?

    I've based my code on the IfCurrentDomain example at http://docs.vaeplatform.com/php_vae_register_tag

  • 1 Answer sorted by
  • This syntax appears to be correct. Can you email [email protected] with your subdomain and a URL to the page and we can check it out further.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion