Tuesday 29 August 2006 3:13:41 am
This is a solution, not perfect, but it works
{section show=$href|contains("pdfdownloads")}
{def $my_node=fetch( 'content', 'node', hash( 'node_path', $href ) )}
{*again a condition, to be sure, it is a pdf file*}
{section show=$my_node.object.data_map.file.content.original_filename|ends_with( '.pdf' )}
<a href=/content/download/{$my_node.object.data_map.file.contentobject_id}/{$my_node.object.data_map.file.id}/file/{$my_node.object.data_map.file.content.original_filename }>{$content|wash( xhtml )}</a>
{section-else}
<a href={$href|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>
{/section}
{section-else}
<a href={$href|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>
{/section}
it fetches the node by the $href, which is my case sth like media/pdfdownloads/myfiles/mypdf.pdf To be sure, that it is a pdf, I added an ends_with condition.
Greetings Heiner PS: this is definitiv more comfortable for users than an object relation. The user can simply add a link on any text or object and search for a node or object
|