If I upload an image to a custom field that has been set to contain an image asset, the upload is successful and I can view the image by clicking on the "View image" link in the entry. I can also embed the image inside a post using the toolbar.
I cannot embed the image into a template by calling the custom field asset. For example, I have a custom field named "entrydatahome_photo" but I'm not able to embed this using the standard method, i.e.,
<mt:IfNonEmpty tag="entrydatahome_photo"> <mt:entrydatahome_photoAsset> <a href="<$mt:EntryLink$>"><img src="<mt:AssetURL />" width="143" alt="" /></a> </mt:entrydatahome_photoAsset> </mt:IfNonEmpty>
Any ideas as to what could cause this?
Reported on Movable Type 4.2
When I check the mySQL database for the entries in this blog, I only see values in the mt_objectasset table for the one entry that is displaying the images properly. None of the other other entries that I've loaded images for show any values in this table.
I run check table in phpMyAdmin, and it seems to be ok.
Tim,
I *think* your problem was that you weren't specifying the id of the asset whose URL you wanted.
this worked for me:
(code that found the id followed, with this fallback:)
You can see that I was just gathering the URL into a variable for use elsewhere, but the idea is the same.
The only significant difference I can spot is that I'm specifying the asset's id. In the above example, I only provide one id, but in practice I check for the entry's asset (limit: 1) and get its id...