When you are placing a related object in an XML field a template called embed is used. The default embed.tpl file shows only the name of the object as a link. If you wish images to be shown differently you should make an override template for the embed.tpl file based on the image class and show the image the way you want.
Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no
I think I can I copy and paste the template used in the admin site but I can't find it. I'm not able yet to write directly the corrects templates so I need example... :(
Thanks a lot...I activated the [Templates settings] in the site ini to find the path...copy and paste the embed.tpl in demo>override>templates>content>view ... It works !
This is great. If you are having problem finding the templates that is used you should try the Debug setting in the [DesignSettings] block in your configuration file. This will show you which templates are included where
Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no
I copied the demo embed_class_5.tpl to my /override/templates/content/view/ directory. I cleared the template cache and refreshed the article but I am still getting a link instead of the image itself. I'm assuming because this is a content view template I do not need to add an entry in my override.ini to point to this file. With template debugging on it still says it is loading design/standard/templates/content/view/embed.tpl
Any idea what I missed? Thanks in advance.
working at www.wardnet.com
blogging at www.jamesward.ca
OK. I tried adding an image_embed record to my override.ini. Since there isn't one in the demo override.ini I'm not sure if mine is correct. This is what I tried:
I copied my image embed template to my design override/templates folder and renamed it image_embed.tpl. I emptied the template and ini cache but the page is still showing a link instead of the image and it is loading design/standard/templates/content/view/embed.tpl instead of my image_embed.tpl.
I assume there is something wrong with my override.ini definition. Any suggestions as to the correct definition? Thanks in advance.
working at www.wardnet.com
blogging at www.jamesward.ca
OK. The problem is definitely my override.ini setting. I replaced the standard embed.tpl with my image_embed.tpl and the image showed up in the article as I had hoped. So I guess the question is, what is wrong with this override.ini record?
As I can see, in the above statement the source is wrong.
Ok, what I did was following:
in the override.ini.append.php
[my_image_embed]
Source=content/view/embed.tpl
MatchFile=my_image_embed.tpl
Subdir=templates Match[class]=5
The content of the File design/demo/override/templates/my_image_embed.tpl is following: