Picked a node with Content picker and now can't display an image
Hi!
So here's my problem. I have a content picker and I want to extract the info in the node. I have successfully extracted the string data but I'm having trouble getting the image. Here is the code:
Picked a node with Content picker and now can't display an image
Hi!
So here's my problem. I have a content picker and I want to extract the info in the node. I have successfully extracted the string data but I'm having trouble getting the image. Here is the code:
What i get is a <img> tag with an empty source. I'm quite lost on how to acess the image. Any thoughts?
Thank you for reading.
Hi Joao,
Looks like you are using an Upload field for that particular image from the node you picked.
Try doing something like
Hi Fuji,
I tried your solution but I get an error loading the script. If i remove the if clause and just go with:
@{var y = @Model.NodeById(pubHigh);}
<img src="@y.doctypeAlias" alt="publication image">
it does not produce an error but I get a blank image again.
you need to change this part and replace the doctypeAlias with the one you are using.
Oh god, that flew right through me!
I got it working now:
However i would keep the if statement in the case my upload field is not a mandatory field just to avoid any error when rendering the code. :)
//fuji
is working on a reply...