Forums / Developer / embedded override template

embedded override template

Author Message

Glenn MacGregor

Monday 09 August 2004 8:24:25 am

Hello,

I am creating an article type which I use a related object (File) and reference that in the body of the article as a link to the file (pdf). The link goes to the default file view page. I want it to go directly to the pdf, which the link on the file full view does. It seems that I need to override the embed template for the file class. I have done this a I am looking at the /templates/content/datatype/view/ezbinaryfile.tpl and copying it. This is not working because I can't find the objects that have the correct attributes. Within my template I use the $object object, within the ezbinaryfile.tpl the $attribute is used, that is not passed to me in my overridden template. No where in any of the objects I have in my telplate can I find the original_filename or filesize values. Can you give me clue on how to do this please?

Thanks

Paul Forsyth

Monday 09 August 2004 8:38:02 am

This might do the trick:

{let pdf_object=fetch(content, object, hash(object_id, $pdfObjectID)}
{attribute_view_gui attribute=$pdf_object.data_map.file} 
{/let}

replace $pdfObjectID with the object id of your related file. this number should be visible in the admin.

This is a direct solution. It retreives the object and calls attribute_view_gui on that objects file attribute. there may be easier ways, but try this first.

paul

--
http://www.visionwt.com