folder -> subfolder -> file download

folder -> subfolder -> file download

Monday 02 February 2004 8:13:18 am - 2 replies

Author Message

Lazaro Ferreira

Monday 02 February 2004 2:11:46 pm

Hi,

You should pickup the file objects from loop, i.e:
{section show=eq($Child:Subfolder:item.object.contentclass_id,'the_id_of_your_file_class')}
{* Here the code that shows the download links *}
{/section}

,then select the attribute 'File' of the file object and add a code like :
{* code to show download link *}
<a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.original_filename|wash(xhtml)}</a> {$attribute.content.filesize|si(byte)}

The code above is used by ezpublish to render the link to download the file in the ezfile view template, you have to change the $attribute variavel to your own, i.e: $Child:Subfolder:item.object.data_map.File

Hope this help

Lazaro
http://www.mzbusiness.com

Alessandro Cipriani

Tuesday 03 February 2004 1:21:23 am

hi lazaro

i think i didn't understand at 100% your answer, anyway i send you the modified code, please tell me if it is right or not...
anyway it doesn't work...

<div class="object_content">
{attribute_view_gui attribute=$node.object.data_map.description}
</div>

{let page_limit=20
children=fetch('content','list',hash( parent_node_id, $node.node_id,
sort_by ,$node.sort_array,
limit, $page_limit,
offset, $view_parameters.offset))}

{section name=Child loop=$children }

<div class="ricorsivachild">
{*<a href={concat("/content/view/full/", $Child:item.node_id,"/")|ezurl}>*}{$Child:item.name|wash}{*</a>*}<br>

{let subfolder_list=fetch('content','list',hash(parent_node_id,$Child:item.node_id))}

{section name=Subfolder loop=$Child:subfolder_list show=eq($Child:Subfolder:item.content.class_id,12)}
<a href={concat("content/download/",$Child:Subfolder:item.data_map.File.contentobject_id,"/",$$Child:Subfolder:item.data_map.File.id,"/file/",$Child:Subfolder:item.data_map.File.original_filename)|ezurl}>{$Child:Subfolder:item.data_map.File.original_filename|wash(xhtml)}</a>
{$attribute.content.filesize|si(byte)}
 


{*<a href={concat("/content/view/full/",$Child:Subfolder:item.node_id,"/")|ezurl}>
{$Child:Subfolder:item.name|wash}</a><br>*}

{/section}
{/let}
</div>
{/section}
{/let}

thanks a lot
alessandro

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.