Attach custom attribute file to template

Permalink
I have created a custom attribute to attach a file (pdf) to a custom template of mine. What I need to know, is how can I display a link to this attached file within the code of the template. I'm guessing it's something similar to the way photos are brought in
$photo = $imgHelper->getThumbnail($c->getAttribute('photo'), 200, 130)->src;
but I can't really find any documentation to get this working right. I appreciate the help!

hursey013
 
jordanlev replied on at Permalink Best Answer Reply
jordanlev
I think the getThumbnail function is a red herring in this case -- what you really want is that "$c->getAttribute('photo')" function.

So if your attribute is called "pdf", I think you'd want something like this:

$file = $c->getAttribute('pdf');
echo $file->getRelativePath();


I haven't tested this, though, so I'm not 100% sure it works.
hursey013 replied on at Permalink Reply
hursey013
This works, thank you very much.