SilverStripe 3.6.1 - if / else_if语句未在模板中设置正确的字段

I'm trying to use an if/else_if statement in my homepage template to check which one of 2 fields have a value. Depending on which field has a value, a link is setup using the value of said variable.

However, as it stands, the setup I have does not work. I have an item with the ImageExternalLink field filled in but the statement seems to still think it's an internal link.

See below--this statement always sets the link as an Internal Link. It's almost like the else_if never is executed, although, I'm not sure why? I feel as if I am following the setup correctly based on the documentation.

div class="halfColumn">
   <% if $ImageLinkInternalURL.Link %>
     <a href="$ImageLinkInternalURL.Link">
         <p>Internal Link</p>
     </a>
    <% else_if $ImageExternalLink %>
        <a href="$ImageExternalLink">
            <p>External Link</p>
        </a>
    <% else %>
        <img class="dropShadow" src="$Image.URL" style="max-height: 220px;">
    <% end_if %>
</div>

For reference, here is the HomePageCallout.php file for reference, which is where the ImageLinkInternalURL and ImageExternalLink fields are created:

<?php

class HomePageCallout extends DataObject {

    private static $db = array(
        'SortOrder'     => 'Int',
        'ButtonText'    => 'varchar',
        'Header'        => 'varchar',
        'ImageExternalLink'  => 'varchar',
        'Description'   => 'HTMLText'
    );

    static $default_sort = "SortOrder ASC";

    // One-to-one relationship with gallery page
    private static $has_one = array(
        'Image' => 'Image',
        'Page' => 'Page',
        'ImageLinkInternalURL' => 'SiteTree',
    );

    // tidy up the CMS by not showing these fields
    public function getCMSFields() {
        $fields = parent::getCMSFields();
        $fields->removeFieldFromTab("Root.Main","PageID");
        $fields->removeFieldFromTab("Root.Main","SortOrder");

        $fields->addFieldToTab("Root.Main", new NumericField("SortOrder"));
        $fields->addFieldToTab("Root.Main", new TextField("ImageExternalLink"), "SortOrder");

        return $fields;
    }

    // Tell the datagrid what fields to show in the table
    public static $summary_fields = array(
        'ID' => 'ID',
        'Header' => 'Header',
        'Thumbnail' => 'Thumbnail',
    );

    // this function creates the thumnail for the summary fields to use
    public function getThumbnail() {
        return $this->Image()->CMSThumbnail();
    }

    public function canEdit($member = NULL) {
        return true;
    }

    public function canDelete($member = NULL) {
        return true;
    }

    public function canCreate($member = NULL){
        return true;
    }

    public function canPublish(){
        return true;
    }

    public function canView($member = NULL){
        return true;
    }
}

$ImageLinkInternalURL.Link will always return some string when you have a $imageLinkInternalURL Sitetree object related in the has_one.

One solution would be to test if the current Object has a $ImageLinkInternalURL Object related by checking the ID of it, $ImageLinkInternalURLID.

<div class="halfColumn">
   <% if $ImageLinkInternalURLID %>
     <%-- we have a has_one, use this --%>
     <a href="$ImageLinkInternalURL.Link">
         <p>Internal Link</p>
     </a>
    <% else_if $ImageExternalLink %>
        <%-- we have an external link defined --%>
        <a href="$ImageExternalLink">
            <p>External Link</p>
        </a>
    <% else %>
        <%-- fallback --%>
        <img class="dropShadow" src="$Image.URL" style="max-height: 220px;">
    <% end_if %>
</div>