Now that we can upload images and save the file name of the uploaded image with the article rijkaard
we can display the image in the browser.
First let's do this in the individual article page in The Root.
After we display the title we can check to see if the article object has the image file attributes set
and if the value of this attribute is null it will evaluate to false.
If it isn't NULL let's add an image tag with the soss attribute set to the Web accessible part of the
image.
The upload folder followed by the name of the image file from the attribute of the article object.
We don't need to use h.t. htl special chars around this value as we sanitize the file name when we uploaded
it.
Let's give that a try.
If I view an article that has an image there's the image that we uploaded for this article.
Let's try an article that doesn't have an image.
And of course no image is displayed.
We can repeat this in the admen article page.
So let's copy this new code and paste it in the same place in the admen article script.
Let's also do the same in the edit article image script so we can see what image we're editing.
If we access the same article in the admin area there we see the image.
And if I click on EDIT article the image it's there as well.