Now I seem to be getting this error and not sure why?
CS1061: 'string' does not contain a definition for 'GetPropertyValue'
and no accessible extension method 'GetPropertyValue' accepting a
first argument of type 'string' could be found (are you missing a
using directive or an assembly reference?)
Thanks I've moved that now I'm getting the following;
CS1061: 'IPublishedContent' does not contain a definition for
'GetPropertyValue' and no accessible extension method
'GetPropertyValue' accepting a first argument of type
'IPublishedContent' could be found (are you missing a using directive
or an assembly reference?)
Umbraco 8 image alt
Hi,
I've added a alt property to my image type and want to render this out.
I have the following line of code;
Which I then render with
Now I seem to be getting this error and not sure why?
Thanks in advance,
Matt
Hi Matt!
Could it be that "carouselId" is a string containing an id and not the actual representation of the image? Then you'd need to retrieve the image first using the id: https://our.umbraco.com/Documentation/Getting-Started/Design/Rendering-Media/
Hi Neils,
I'm afraid I'm a little lost now!
here is my code;
So on this line;
"newsImage" is what my mediaPicker is called.
But I get
Hi,
the problem is that you are using newImage before you define it. Your image has the altText, so you can only get the altText if you have the image.
Try moving this line:
to a place after you defined your newsImage:
~ Jonathan
Hi,
Thanks I've moved that now I'm getting the following;
I'm using umbraco 8
Thanks
Hi Matt,
sorry, in U8 you use:
~ Jonathan
Try something like that.
What I've done is move where you are getting your alt description to where you need it.
Thanks
Nik
Hi Nik,
thanks for your contribution.
Unfortunatly this codeline:
won't work, because you cant use generic types in HTML like this.
If you wan't to have type safety, the easiest way is to define an extra variable. If not you could use:
~ Jonathan
Seems overly verbose to have an alternative "ALT" value, when newsImage.Name would probably suffice :-)
is working on a reply...