- Issue created by @Ricardo García
When using the acquia_dam module in a view, the "no result found" message does not correctly display the type. This makes it difficult for users to understand the context of the missing content. In my specific context, the client wants to show the type of media in the "no result found" message to provide clearer feedback to users.
Update the AcquiaDamTextCustom plugin to handle different media types based on the view arguments. The client specifically wants to display the type of media in the "no result found" message. Here is the proposed code change:
...
$media_type = '';
// Check if the view arguments are set and determine the media type.
if (isset($this->query->view->args[0])) {
$view_args = $this->query->view->args[0];
switch ($view_args) {
case 'acquia_dam_documents_asset':
$media_type = 'Document';
break;
case 'acquia_dam_image_asset':
$media_type = 'Image';
break;
case 'acquia_dam_pdf_asset':
$media_type = 'PDF';
break;
case 'acquia_dam_spinset_asset':
$media_type = 'Spinset';
break;
case 'acquia_dam_video_asset':
$media_type = 'Video';
break;
}
}
...
// Return the appropriate message based on the obtained values.
if ($media_type !== '') {
return ['#markup' => "No result found for $media_type."];
}
Active
1.0
Code