Full URL for an attached file on the text editor

Author Message

Ahmed Arous

Tuesday 11 January 2011 3:25:51 am

Hello,

When i want to attach a file using "Insert Object" on the text editor, it generate a link with relative URL ( <a href="/content/download/7330/78358/file/file.pdf"> ) but i need it to be a full URL ( <a href="http://mysite.com/content/download/7330/78358/file/file.pdf"> )

Is that possible ?

Gaetano Giunta

Tuesday 11 January 2011 5:09:58 am

You should be able to override the template used to display that link.

Iirc (but you should check it) it is: .../templates/content/view/embed.tpl or .../templates/content/view/embed-inline.tpl

Where it says {$object.main_node.url_alias|ezurl} put {$object.main_node.url_alias|ezurl(no, full)}

Principal Consultant International Business
Member of the Community Project Board

Gaetano Giunta

Tuesday 11 January 2011 5:10:39 am

ps: if this is because the link is present in an html email sent by eZP, the correct fix should be different...

Principal Consultant International Business
Member of the Community Project Board

Ahmed Arous

Tuesday 11 January 2011 5:39:10 am

thank you Gaetano Giunta,

the link is present in an html email, so how should i fix it ?

Bertrand Dunogier

Tuesday 11 January 2011 7:13:23 am

You need to prepend the file's URL |ezurl returns with the protocol (http or https) and the hostname.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Ahmed Arous

Tuesday 11 January 2011 7:41:11 am

thank you !

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 18 2025 05:14:31
Script start
Timing: Jan 18 2025 05:14:31
Module start 'layout'
Timing: Jan 18 2025 05:14:31
Module start 'content'
Timing: Jan 18 2025 05:14:31
Module end 'content'
Timing: Jan 18 2025 05:14:31
Script end

Main resources:

Total runtime0.0171 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.4766152.6406
Module start 'layout' 0.00740.0025 742.117239.4844
Module start 'content' 0.00990.0052 781.601693.2891
Module end 'content' 0.01510.0019 874.890634.2891
Script end 0.0170  909.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003319.2341140.0002
Check MTime0.00127.0921140.0001
Mysql Total
Database connection0.00126.792210.0012
Mysqli_queries0.002514.488430.0008
Looping result0.00000.069710.0000
Template Total0.00169.210.0016
Template load0.00095.365110.0009
Template processing0.00073.837610.0007
Override
Cache load0.00073.813910.0007
General
dbfile0.00031.780080.0000
String conversion0.00000.047440.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