How Images work in Umbraco V4 Options
amritanshu
Posted: Monday, September 08, 2008 2:33:58 PM

Rank: Enthusiast

Joined: 7/2/2008
Posts: 34
Location: India
Hi

I am trying hard but could not figure out how images works in v4 in Templates... Anxious

In V3 I used images like
Code:

<img src="<?UMBRACO_GETITEM field="ProductsImages"/>" alt="" />


but If wish to do the same in V4 I get error... I tried using quotes and without quotes and also with different braces.. nothing works... Eh?
Code:

<img src="<umbraco:Item field="ProductsImages" runat="server"></umbraco:Item>" alt="" />
also
<img src=<umbraco:Item field="ProductsImages" runat="server"></umbraco:Item> alt="" />


Please help in using the images in V4

Thanks,
Amritanshu

Good judgment comes from experience, and often experience comes from bad judgment. So experience is simply the name we give our mistakes...
kalpa
Posted: Monday, September 08, 2008 7:39:43 PM

Rank: Fanatic

Joined: 7/19/2006
Posts: 496
Location: Göteborg, Sweden
In V4 getitem is replaced with Umbraco:Item, click the help symbol for correct syntax..

// ;) Kalle

" - Yeah I'd like to share your point of view, as long as it's my view too... (http://www.d-a-d.dk/lyrics/pointofview)
amritanshu
Posted: Wednesday, September 10, 2008 9:59:27 AM

Rank: Enthusiast

Joined: 7/2/2008
Posts: 34
Location: India
Hi Kalle,

I already mentioned that part in my post... I knew that
Quote:
In V4 getitem is replaced with Umbraco:Item, click the help symbol for correct syntax..


thats what I have mentioned in my problem too that I am using
Quote:
but If wish to do the same in V4 I get error... I tried using quotes and without quotes and also with different braces.. nothing works...
Code:
Code:

<img src="<umbraco:Item field="ProductsImages" runat="server"></umbraco:Item>" alt="" />
also
<img src=<umbraco:Item field="ProductsImages" runat="server"></umbraco:Item> alt="" />


Please help in using the images in V4
...

I hope u understand that its not the issue....

thanks for the response but I am still in the mess....d'oh!

Good judgment comes from experience, and often experience comes from bad judgment. So experience is simply the name we give our mistakes...
Adz
Posted: Wednesday, September 10, 2008 10:04:21 AM

Rank: Aficionado

Joined: 6/5/2008
Posts: 148
Location: United Kingdom
I think you need to replace some of your double-quotes " with single quotes ' .

Code:

<img src="<umbraco:Item field='ProductsImages' runat='server'></umbraco:Item>" alt="" />



Adam Perry (blog, twitter), developing Umbraco based websites and applications for ConnectDigital.
amritanshu
Posted: Wednesday, September 10, 2008 11:26:11 AM

Rank: Enthusiast

Joined: 7/2/2008
Posts: 34
Location: India
Bingo !!! it works.... Thanks Adz... I should have figured out that....

Good judgment comes from experience, and often experience comes from bad judgment. So experience is simply the name we give our mistakes...
Adz
Posted: Wednesday, September 10, 2008 11:27:01 PM

Rank: Aficionado

Joined: 6/5/2008
Posts: 148
Location: United Kingdom
Glad i could help :-)

Adam Perry (blog, twitter), developing Umbraco based websites and applications for ConnectDigital.
Jaynard
Posted: Friday, September 12, 2008 11:13:00 AM
Rank: Newbie

Joined: 9/11/2008
Posts: 8
Location: Sundsvall, Sweden
I'm using Umbraco V3.0.3 and when I try to use:

Code:
<img src="<?UMBRACO_GETITEM field="contentImage"/>" alt="" />


Where "contentImage" is my alias for the Media Picker, all i get is the ID for the image, not the URL.

I thought it was supposed to be like that and made a Macro to render images from a media picker, but when the original poster in this code said he used this code to show images in Umbraco V3, I got a little curios on why it doesn't work for me.

Any settings I might be missing somewhere?

//J
drobar
Posted: Friday, September 12, 2008 3:00:08 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
If you have a MediaPicker you'll get the ID. But if you have an Upload control you'll get the path. That's the difference and why the code works for some people and not for others.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.