I'm trying to display a random featured item with:
(1) an embedded object if the current item has that field and isn't empty OR (2) the default display_random_featured_item if the embedded field is empty or if that field doesn't exist. Am I close with the following? Thanks.
<?php
$featured = random_featured_item();
set_current_item($featured);
if(item_has_type('Music-Related Instructional Video'))
{
$hasEmbeddedField = item('Item Type Metadata', 'Embedded Object');
if($hasEmbeddedField == '')
{
echo display_random_featured_item();
}
else
{
echo $hasEmbeddedField;
}
endif;
}
else
{
echo display_random_featured_item();
}
endif;
?>