Commit 3a32cda3 by rajshah

fix the xls document type in resource listing block v0.2

parent 12611fef
......@@ -6,8 +6,8 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
if ($enable_resources_listing):
$resources_items = $resources_listing['resources_items'] ?: [];
if (isset($resources_items) && is_array($resources_items) && !empty($resources_items)):
?>
<section class="resource-listing py-80 makura-new">
?>
<section class="resource-listing py-80 makura-new">
<div class="container">
<div class="row">
<div class="col-lg-4 col-xl-3">
......@@ -85,25 +85,25 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
$subtype = $upload_downloadable_resource['subtype'];
switch (strtolower($subtype)) {
case 'pdf':
$icon = 'PDF';
$icon_url = get_field('pdf_image', 'option');
break;
case 'doc':
case 'docx':
$icon = 'DOC';
$icon_url = get_field('doc_image', 'option');
break;
case 'xls':
case 'xlsx':
case 'vnd.ms-excel':
case 'vnd.openxmlformats-officedocument.spreadsheetml.sheet':
$icon = 'XLS';
$icon_url = get_field('xls_image', 'option');
break;
case 'ppt':
case 'pptx':
case 'vnd.openxmlformats-officedocument.presentationml.presentation':
$icon = 'PPT';
$icon_url = get_field('ppt_image', 'option');
break;
default:
$icon = 'PDF';
$icon_url = get_field('default_image', 'option');
}
endif;
endif;
......@@ -116,8 +116,7 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
</div>
</div>
</div>
<?php }
endforeach; ?>
<?php }endforeach; ?>
</div>
</div>
<?php endif; ?>
......@@ -127,8 +126,6 @@ if (isset($resources_listing) && is_array($resources_listing) && !empty($resourc
</div>
</div>
</div>
</section>
<?php endif;
endif;
endif; ?>
</section>
<?php endif; endif; endif; ?>
<!-- !Resources - Resources Listing -->
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment