PDf Thumbnail
Permalink
Hi:
I am building a website that have a downloadable file list. Each file(image) has a thumbnail.
But the PDF does not have a thumbnail.
I made a image/file file attribute so i can manually put the thumbnail.
Does anyone knows how i can get that attribute and output the attribute URL
I am building a website that have a downloadable file list. Each file(image) has a thumbnail.
But the PDF does not have a thumbnail.
I made a image/file file attribute so i can manually put the thumbnail.
Does anyone knows how i can get that attribute and output the attribute URL
![jero](/files/avatars/36216.jpg)
I'm not sure you can have an image/file attribute attached to a file. Do you mean perhaps that you've added a text attribute instead, or have you added the attribute to a page? Please explain in more detail.
Well if you go to System & Settings > Attributes > Types and check File in the image/file row you can use this kind of attribute on files.
I just dont know how to output in a block
I just dont know how to output in a block
Oh, right. OK, well assuming you know the ID of the file that you're working with, you could try this:
Then you can get the url, height and width like this
or if you need to generate a thumbnail of say, 50px square:
$fID=42; // file id $att='my_attribute'; // attribute handle $fo=File::getByID($fID); // get the file object $at=$fo->getAttribute($att); //get the attribute, which returns another file object.
Then you can get the url, height and width like this
or if you need to generate a thumbnail of say, 50px square:
Did you get this working? I need to do something similar with a different file type.
Yes try to follow Jero post.
Go to System & Settingd > Attributes > type and check File in the image/file row.
Then add a file attribute using image/file attribute type.
And manually add the thumbs
Go to System & Settingd > Attributes > type and check File in the image/file row.
Then add a file attribute using image/file attribute type.
And manually add the thumbs