Friday 23 January 2009 1:51:24 am
Hi Andre; Following the steps described in the blog's post produces a link like: http://www.site.com/index.php?/site/Media/Files/File_name Of course people can't download it since they don't have access to Media folder. How to get the addres like: http://www.site.com/index.php?/site/content/download/529/3682/file/File_name.pdf ? o_O The template used in that example is:
{def $n='' $attribute='' $url=false() $protocols=array('http', 'file', 'ftp', 'mailto', 'https')
}{if $protocols|contains( $href|explode(':')|extract_left(1) )not()
}{set $n=fetch(content, node, hash(node_path, $href))
}{if and($n, $n.object.class_identifier|eq('file'))
}{set $attribute=$n.data_map.file
}{set $url=concat( '/content/download/', $attribute.contentobject_id, '/', $attribute.id,'/version/', $attribute.version , '/file/', $attribute.content.original_filename|urlencode )
}{/if}{/if}{if $url|not()}{set $url=$href}{/if}<a href={$url|ezurl}{section show=$id} id="{$id}"{/section}{section show=$title} title="{$title}"{/section}{section show=$target} target="{$target}"{/section}{section show=ne($classification|trim,'')} class="{$classification|wash}"{/section}>{$content}</a>{undef $n $attribute $url $protocols}
Shiki soku ze ku...
|