Forums / General / Image tags

Image tags

Author Message

Iris Hoekstra - Roscam Abbing

Wednesday 25 February 2004 11:57:41 am

With interest I have been reading on the special image tags in EZPublish 2. I tried to use them in EZ 3 but to no avail. I related an image to an article, then tried to insert it in the article body with <image 105 left medium>, 105 being the image's ID.

The admin interface didn't like this tag and threw it out.

Do image tags no longer exist in EZPublish? If so, why not? And if they are still there, is there any documentation on them anywhere?

James Packham

Thursday 26 February 2004 2:49:34 am

It's been replaced by <object> tags, seeing as images are just another class of object as far as the database is concerned. Search to find out more.

Regards,

James

Iris Hoekstra - Roscam Abbing

Thursday 26 February 2004 3:36:24 am

Thank you, James. Your response led me to http://www.ez.no/ez_publish/documentation/customization/components/datatypes/ezxmltext/tags which clarifies a lot.

However, when I insert my image into my article's body by means of <object id="105" size="small" align="right" /> it just inserts the name of the image. But I would like to see the image itself.

What am I missing?

James Packham

Thursday 26 February 2004 5:50:42 am

As far as I know due to limitations of EZXML somethings like align and size that would otherwise work html don't work (I'm not sure about the reasons for this). However you can make the the changes in the templates. It sounds a bit complicated, but it's quite easy if you follow a step-by-step example:

Example: You want to align your image right in EZXML, align isn't allowed in EZXML so you must create a template override to be matched on class. For simplicity we'll use a table to align the object.

in override/site.ini.append.php create content.ini.append.php add these lines:

[td]
AvailableClasses[]=tdRight

In settings/override/override.ini.append.php add this:

[td_class_right]
Source=content/datatype/view/ezxmltags/td.tpl
MatchFile=tdRight.tpl
Subdir=templates
Match[classification]=tdRight

now copy design/standard/content/datatype/view/ezxmltags/td.tpl
to
design/[siteaccess]/overrides/templates/tdRight.tpl

(repeat for each siteaccss you want to use it in)

and in the new file change the code so that align=right.

Clear your caches

Now in your EZXML whenever you need to align something to the right in a table: <td class="tdRight"><object id=222></td>

Changing sizes is a little more complicated, but I think I've given you enough there to figure it out. :)

Regards,

James

Iris Hoekstra - Roscam Abbing

Thursday 26 February 2004 12:28:58 pm

Hi James,

Thank you for explaining all that. I hope you don't think I'm stubborn :-) but I believe you *can* add 'size' and 'align' to an <object> tag. It says so in the documentation.

Maybe I haven't explained the problem very well. When I insert an article by means of <object id='105' align="right" size="small"/>, I see in my webpage just the name of the image, instead of the image itself. The name is a link to the image. When I check the source it says <a href="/index.php/elysee/prestige">, there is no image tag anywhere.

Can someone help me before I tear all my hair out.

Iris Hoekstra - Roscam Abbing

Thursday 26 February 2004 1:29:23 pm

FINALLY I stumbled on a solution elsewhere in the forum. I had to override C:\eZpublish\ezpublish\design\standard\templates\content\view\embed.tpl. It's working now. Pfff... The 'align' attribute still doesn't do what it's supposed to do but the 'size' attribute does. Thanks for your time, James. I think your solution would have worked too but this seems a little easier.

I still find it odd that the standard way for displaying an image (i.e. when you don't override anything) is without the image! Then again, that probably has to do with the fact that an <object> could be many different things.

Bruce Morrison

Thursday 26 February 2004 3:49:27 pm

Hi Iris

You will probably find thzat the align attribute is not doing what you expected because you are missing the required styles in the style sheet. Either copy the relevant image styles from design/standard/stylesheets/core.css or include this entire file.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

bob barker

Saturday 17 April 2004 3:22:12 pm

Can you explain to a novice exactly how to implement the override mentioned in the above response. I too am trying to insert images in article bodies and, although the image shows correctly in admin mode, it showns only as a link in normal user mode.

bob barker

Saturday 17 April 2004 3:42:38 pm

For clarity, my question refers to the post from "Iris Hoekstra - Roscam Abbing" - could you help a novice understand how to implement the override that you mentioned. In the override template, what addditional code, if any, needs to be added to the template? Thanks