default userpic

What could cause a Custom Field image asset to not display?

Vote 0 Votes

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

2 Replies

| Add a Reply
  • 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...

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012