Forums / Setup & design / Including an image inside a paragraph of an xml text

Including an image inside a paragraph of an xml text

Author Message

Zoltan Szabo

Saturday 14 August 2004 2:35:31 am

I try to include an image inside a paragraph of an xml text.
I mean someting like this:

<p><img src="images/01.jpg" width="113" height="150" hspace="8" vspace="2" border="1" align="right" />Then something begin</p>
<p>And then another paragraph</p>

The text is from an xml area.
Is it possible via a related object image and some special "class="?
Or some kind of overriding of the paragraph.tpl?
Or some custom tag?

Trond Åge Kvalø

Tuesday 17 August 2004 12:39:11 am

Do you use the online editor to edit you XML-textefields?

I do and here's the method I use to insert images into an XML textfield.

First I upload the images I need to the images folder in the media tab.

The I edit the article/folder/whatever that contain my XMLtextfield.

In the right hand table there's a field called related objects.

Click the magnifying glass, navigate to the media/images folder and choose the image(s) you want.

Now that the images are marked as related objects you can use the insert image button in the online editor.

Hope this made some sense.

If you can afford it, I recommend using the online editor.

Best regards
trondåge

trondåge

Zoltan Szabo

Wednesday 18 August 2004 3:05:48 am

Thank you, the including of related object is working (I do not use OE, because I use Firefox and Opera browsers).

The images are all right now, but if I would like to include a downloadable file INTO A ROW (and not under the last row), the system always put some

<div class="object-center">

into the source.

Can you help me, where can I find the responsible code, or how could I eliminate this DIV thing?

(There were some

<p>...</p>

parts also, but I could eliminate it via a paragraph.tpl override...)

--zol

Trond Åge Kvalø

Thursday 19 August 2004 2:14:57 am

Hi Zoltan.

Glad it worked.

I'm not sure about the downloadable file, though. But this is how I would have gone about to solve it.

First enable template debug in your site.ini.append, this will show you which template is used for the downloadable file. Then perhaps you could override this template the same way you did with paragraph.tpl?

There's an object.tpl in the same folder as paragraph.tpl that let's you choose whether the object is rendered as a block or inline. You could try to override that and see if that works.

best regards
trondåge

trondåge

Eckhard Schnell

Thursday 19 August 2004 2:49:30 am

Hello,

I post yesterday a bug for that. My solution is the following
i put the /design/standard/templates/content/datatype/view/ezxmltags/objetc.tpl in my design and i make some minor changes
here there are

    {section show=eq($object_parameters.class, "NoNewLine")|not}
    <div class="object-{$object_align}">
        {content_view_gui view=$view object_parameters=$object_parameters content_object=$object}
    </div>
    {section-else}
        {content_view_gui view=$view object_parameters=$object_parameters content_object=$object}
    {/section}

In the content.ini.append of your siteaccess or in the override you have to define the following

[object]
AvailableClasses[]=NoNewLine

Now you cann select in Properties field of that object the class NoNewLine.
The Object will be placed in the same line.

Eckhard Schnell

Eckhard Schnell
Siemens Business Services http://www.sbs.de
Privat: http://www.2schnell.de

Zoltan Szabo

Thursday 19 August 2004 7:44:52 am

Thank you, it's an elegant solution...

--zol