Forums / Setup & design / image id??

image id??

Author Message

sim b

Tuesday 13 April 2004 6:25:01 am

Hy,
i know it is a stupid question, but i&acute;m a newby. I just want to get an image on one InfoPage. I tried <object id="154"/> but this is the id of the homepage. Where can i find the right id for my image, and is the code right?

thanks

John Mina

Tuesday 13 April 2004 7:27:22 am

Hey Sim
Sorry
but this is a wrong code i guess
first
where is that picture was it uploaded with an article or what ?
second
if you uploaded the picture ur self where did u add it, to which folder?

Hope i can help
JOhn

sim b

Tuesday 13 April 2004 10:07:12 am

well, i have got a "test.gif" and i would like to put it on one InfoPage. If you edit a InfoPage it is possible to upload an image (done that), the image is already shown in the admin mode, but i have to type in some code in the Textbox to see it in the web. The Image is in no folder (just on the InfoPage).How can i solve it?
isn&acute;t it possible to show only one image on the page, and nothing else (no text)???
thanks

John Mina

Wednesday 14 April 2004 1:02:34 am

Well igot your question now actually i was running into it 2 times before
so here you are
You can do that in 2 ways
First if the image is uploaded with an article or an infopage:-
1-Fetch the node that represents the infopage or article
2- type in the following code

{* Check to see if there is an actual image *}
{section show=$news.item.data_map.thumbnail.content.is_valid}
{* There is an image display it *}
{attribute_view_gui attribute=$news.item.data_map.thumbnail image_class=large}
{/section}
{*class = large /medium/small that is the size of the generated output*}

or also you can use

{section show=$node.data_map.thumbnail.content.is_valid}
<img src={$node.data_map.thumbnail.content.small.url|ezroot} />
{/section}

Second way can be used if you don't need an article, or info page there is an object named image to be used , and use the previos stpes therei gues sit should work

let me know if that helped
BEst regards
John

sim b

Wednesday 14 April 2004 5:13:12 am

Thanks a lot for your effort, but if i put this text into the content box, only this text is shown on the webview.
Have i to copy it in any template?
Why is it so complicated to publish an image? As i remember in an older version of ezpublish you could publish an image with html Tags.
bye

Alex Jones

Wednesday 14 April 2004 6:09:55 am

Sim, the code does need to be placed in your template. Adding an image is actually really easy, as all you have to do is click the browse button when entering a new Article, Infopage etc. The first bit of code that John provided will check to see if there is an image associated with the object, if so it will display it in the way laid out in your template, thus ensuring consistency for all of your articles. One note, you may need to change <i>thumbnail</i> to the attribute identifier associated with the image in that class. I believe the default name for this attribute in an Infopage is <i>image</i>.

If you want to add an image in the middle of your text you will need to use the Related Objects box to the right of the text input area. If the image already exists in the Media area you can click on the magnifying glass icon to locate the one you want. If the image is not on the site click on the <i>New</i> button and upload the image. When you have finished one of those steps copy and past the object tag that is in that box (it should look a lot like the one in your original post).

So, with all of that said, you mentioned that the <i>object id</i> is that of the home page. Had you followed one of the two steps I noted above? If so, did you check to make sure that you selected the radio button next to the image you wanted? It may be that the default radio button is the home page which could cause the confusion. It may be best to go through the process again to make sure the right object is selected.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

sim b

Wednesday 14 April 2004 12:58:58 pm

Man, i think i am going crazy. I&acute;ve done everthing you said (so far i understood it right), but my only result was a link to an other side, but no image.
In which template i&acute;ve to put the code?
If you got the nerv to tell me a last time what i shall do.. step by step... otherwise I&acute;ll try an other CMS.

thanks again

Alex Jones

Thursday 15 April 2004 8:32:26 am

I just noticed a typo on my part in my earlier posting. It should read <i>the code does <b>not</b> need to be placed in your template</i> I am really sorry about that. I'm not sure where else you can look for an object ID if the code provided in the <i>Related Objects</i> box on the right side of the page provides the wrong ID. Hopefully someone else can chime in and help out?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>