File Attribute as Download link

Permalink
Hi folks

BEGINNER ALERT!!

So I have my page type, in which I load an image and a pdf.

The image part is cool.
The pdf part is causing me headaches.

SCENARIO 1
If I create an Image/File attribute, add it to the form and output of my page type, then load a pdf as a piece of content...
Result: "An image could not be created from the given input"

If I create an override in 'application/blocks/file' or 'application/blocks/image' or 'application/blocks/page_attribute_display' no changes occur.


SCENARIO 2
If I add the file block when constructing the page layout, i.e. adding blocks to the positions I have to add a file there and then. Not allowed to add a file per new content. It seems I can only add a file which will be shown on every piece of content. Or on each new piece of content, do the composer thing, and then afterwards, add a file block to the page.


I was hoping to load a file with each new content of a page type.
Render a download link which references the pdf.

I am a beginner so should maybe take it easier but ...

Bucklash

Bucklash
 
hutman replied on at Permalink Reply
hutman
Just to clarify, what you are looking for is to have one block on the page where you can select a file, if that file is an image you display the image, if that file is not an image you display a download link?
Bucklash replied on at Permalink Reply
Bucklash
Hi

Sorry it wasn't clear.

Ultimately I'm hoping to have in the composer form the ability to add an image, and also the ability to add a pdf (not either/or).

The idea is that I load a pdf, and the image represents what the pdf contains
hutman replied on at Permalink Reply
hutman
I think you can do this with the standard content block, just put an image in the content and then add a link to the image that links to the PDF file.
Bucklash replied on at Permalink Reply
Bucklash
Hi

Ok, thanks, that clarifies how to approach it