Show related objects - pictures, pdf and so on

Author Message

Valentin Svelland

Wednesday 16 July 2003 12:31:42 am

I find the standard way to upload picture very easy to grasp for beginners introduced to the eZ 3.x-solution. But when more than this one picture is needed it's not as easy, at least not yet.

I've made a separate folder for pictures at root-level and subfoldes for different categories of images in this. E.g. Politics, nature, people and so on. I add them as related objects in the article and copy/paste the <object> tag into the body-field of the article. Still, the picture is only shown as a link in the full-view of the article. I want it to shown directly and with some way to decide alignment from the admin-gui.

I guess I've forgotten to override some template, but if you got the solution I got one more: I also want to show related pdf- and word-files as links with pdf-/word-icons as well as filesize in Kb written in the end. Could you also give me a hint about how to accomplish this?

Example:
[PDF-icon] ClickableFilename.pdf (125 Kb)

Bjørn Kaarstein

Wednesday 16 July 2003 1:38:39 am

You need to place embed_class_5.tpl in yourdesign\override\templates\content\view in order to show the pictures directly.

As for your second question, I believe you will have to write embed overrides for your file class aswell.

Regards Bjørn

Valentin Svelland

Wednesday 16 July 2003 1:45:49 am

Thanks Bjørn, I've already copied embed_class_5.tpl from the demo site into the folder you refer to, but I just can't get it to override /design/standard/templates/content/view/embed.tpl. It works if I overwrite this file with my embed_class_5.tpl-code directly, but that's hardly a good solution.

I've turned of all caching and on debugging to see which template files are loaded, so I know this for sure. Why won't my embed_class_5.tpl overwrite the standard embed.tpl?? I'm going mad.. :)

Bjørn Kaarstein

Wednesday 16 July 2003 2:26:47 am

Which version of ez are you using? embed_class_5.tpl should work fine in 3.0, but in 3.1 I think there's a new override system. I haven't upgraded yet, so I'm not really sure how to use this system.

Take a look here, if you're using 3.1.

http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

Let me know if you use 3.0, and I'll try to figure out what is wrong. No promises of a solution though, but I'll try :)

Regards Bjørn

Valentin Svelland

Wednesday 16 July 2003 2:54:16 am

Thanks Bjørn! You're last posting really gave me some useful hints. Yes, I use v.3.1 (and will upgrade to v.3.2 the 17th of September :)) and the link you posted had the solution:

I wasn't aware of the new override system so I just couldn't figure this out until I read this. I checked out the override.ini.append at the /settings/siteaccess/admin and quickly realized I were missing this lines in my own override.ini.append:

[embed_image]
Source=content/view/embed.tpl
MatchFile=embed_image.tpl
Subdir=templates
Match[class]=5

[text_linked_image]
Source=content/view/text_linked.tpl
MatchFile=text_linked_image.tpl
Subdir=templates
Match[class]=5

Thanks again Bjørn, the likes of you really make this forum a damn good resource.

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 16:21:28
Script start
Timing: Jan 18 2025 16:21:28
Module start 'layout'
Timing: Jan 18 2025 16:21:28
Module start 'content'
Timing: Jan 18 2025 16:21:29
Module end 'content'
Timing: Jan 18 2025 16:21:29
Script end

Main resources:

Total runtime1.4546 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1797152.6406
Module start 'layout' 0.00600.0029 741.820339.4766
Module start 'content' 0.00891.4439 781.2969531.6719
Module end 'content' 1.45280.0018 1,312.968816.1250
Script end 1.4546  1,329.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2449160.0002
Check MTime0.00140.0968160.0001
Mysql Total
Database connection0.00100.069410.0010
Mysqli_queries1.390295.5742630.0221
Looping result0.00070.0449610.0000
Template Total1.415697.320.7078
Template load0.00240.166420.0012
Template processing1.413197.146320.7066
Template load and register function0.00010.007910.0001
states
state_id_array0.00150.103110.0015
state_identifier_array0.00260.180820.0013
Override
Cache load0.00220.1492380.0001
Sytem overhead
Fetch class attribute can translate value0.00090.063320.0005
Fetch class attribute name0.00150.104460.0003
XML
Image XML parsing0.00070.047620.0003
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00080.0575160.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs