How to fetch filename

Author Message

John Smith

Thursday 08 June 2006 4:22:45 am

Hi there,

Hope someone can help me please.

In the design\news\override\templates\datatype\ezbinaryfile.tpl

{default icon_size='normal' icon_title=$attribute.content.mime_type icon='no'}
{section show=$attribute.has_content}
{section show=$attribute.content}
{switch match=$icon}
    {case match='no'}
        <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)}
    {/case}
    {case}
        <a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.mime_type|mimetype_icon( $icon_size, $icon_title )} {$attribute.content.original_filename|wash(xhtml)}</a> {$attribute.content.filesize|si(byte)}
    {/case}
{/switch}
{section-else}
	<div class="message-error"><h2>{"The file could not be found."|i18n("design/base")}</h2></div>
{/section}
{/section}
{/default}

Here I want to fetch the name of the file given to the file while uploading. I Tried $attribute.content.name, $attribute.name but nothing working at all.

Please help.

Marcin Drozd

Thursday 08 June 2006 5:30:22 am

Hi
I am not sure what U want but try with:
{$attribute.content.filename}
{$attribute.content.original_filename}
{$attribute.object.name}
and U should listing all attributes and values:
{$attribute.content|attribute(show,1)}

http://ez-publish.pl

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

eZ debug

Timing: Jan 21 2025 02:41:38
Script start
Timing: Jan 21 2025 02:41:38
Module start 'layout'
Timing: Jan 21 2025 02:41:38
Module start 'content'
Timing: Jan 21 2025 02:41:38
Module end 'content'
Timing: Jan 21 2025 02:41:38
Script end

Main resources:

Total runtime0.0155 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.8906151.1953
Module start 'layout' 0.00730.0035 739.085936.6172
Module start 'content' 0.01080.0032 775.703190.1406
Module end 'content' 0.01400.0014 865.843829.9922
Script end 0.0154  895.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.9201140.0002
Check MTime0.00117.3730140.0001
Mysql Total
Database connection0.00106.423810.0010
Mysqli_queries0.003824.364030.0013
Looping result0.00000.149510.0000
Template Total0.00117.010.0011
Template load0.00085.351410.0008
Template processing0.00031.648710.0003
Override
Cache load0.00063.768910.0006
General
dbfile0.00010.943080.0000
String conversion0.00000.077040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs