Forums / Setup & design / Show related objects - pictures, pdf and so on

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.