Hi,
Thank you for waiting, while I performed some tests on my website.
In order to achieve a layout similar to the screenshot, you can follow these steps:
1. You can start by inserting a "Grid" block in your content template, which has two columns and 3 rows, as you have 3 field type custom fields.
( ref: https://toolset.com/block-item/grid/ )
2. On the left column of each row, you can type the title text, that you'd like to show before the file links.
3. On the right column of each row, you'll insert the "Single Field" block for the file type fields which can only have one file, and the "Repeating Field" block for the fields which can have multiple files.
Example screenshot "Single Field" block:
hidden link
Example screenshot "Repeating Field" block:
hidden link
4. Please also include a special class "special-link" class into the "File link extra classes" field of these two blocks, as can be seen in the last two screenshots.
These classes will help in targeting these links through custom CSS and JS code.
5. Next, in the "JS editor" field of the content templace, you'll include some custom script, so that it can get the file's extension type and add a special class in the generated links (e.g. pdf-type, xls-type etc )
jQuery(document).ready(function(){
jQuery('a.special-link').each(function(){
var link = jQuery(this).attr('href');
var extension = link.substr( (link.lastIndexOf('.') +1) );
if (extension){
jQuery(this).addClass(extension+'-type');
}
});
});
6. You can upload the icon/image files in the media library for the default/fallback icon and other type of file types and copy their links for example:
yourwebsite.com/wp-content/uploads/2020/09/default-file-icon.jpg
yourwebsite.com/wp-content/uploads/2020/09/PDF-file-icon.jpg
yourwebsite.com/wp-content/uploads/2020/09/XLS-file-icon.png
7. The last step would be to include some custom CSS code in the content template "CSS editor", to link these file type icons with each type of file link and show them as a background image:
a.special-link {
color: transparent;
display: block;
background-image: url(yourwebsite.com/wp-content/uploads/2020/09/default-file-icon.jpg);
background-repeat: no-repeat;
background-size: contain;
width: 50px;
height: 50px;
float: left;
}
a.special-link.pdf-type {
background-image: url(yourwebsite.com/wp-content/uploads/2020/09/PDF-file-icon.jpg);
}
a.special-link.xls-type {
background-image: url(yourwebsite.com/wp-content/uploads/2020/09/XLS-file-icon.png);
}
Please replace the icon image URLs with the actual ones from your website.
Example screenshot of the result:
hidden link
I hope this helps and please let me know if any step is not clear.
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar