default userpic

Help with custom fields upgrade

Vote 0 Votes

I have a site working quite nicely on MT4.01 (artformhomeplans.com). There are some quirks with Custom Fields so we wanted to upgrade. I upgraded from 4.01 to 4.13 and then to 4.32. I have staged the site on a spare domain first, steele-marketing.biz.

Testing seemed to go well, until we added a new entry. You'll see that the site can display sample house plans for selected series of houses. But if you go to "expandables" on each site, you'll see that the old site and the new site ONLY for old/prior data, displays the thumbnails correctly, but new site displays the thumbnails as a "View Image" link instead of the thumbnail image itself. The source code is the same.

MT source code:

"> ()



">

But MT creates page entries with two different outputs! Sample:
View image

and then a few lines later for the next image:



In the first case I get "view image" and in the second I get the image.

Is there a new parameter or something I missed in 4.32, did the d/b not convert or ?... thx.

Reported on Movable Type 4.3

6 Replies

| Add a Reply
  • Hi Lee,

    Unfortunately, as you didn't strip the angle brackets "<" as "&lt;" and ">" as "&gt;" I cannot see your current coding.

    However, assuming that your image custom field is EntryDataMyField, your coding should look like:





    What you should include now is the inner "mt:EntryDataMyFieldAsset" loop ;)

  • Hi Mihai,
    Sorry about that... Here is the code with angle brackets stripped off:

    MT code:

     <fieldset class="plan_list">
    <legend> <a href="<$MTEntryPermalink$>"><$MTEntryDataPlanName$></a> (<$MTEntryTitle$>) </legend>
    <table>
    <tr>
    <td rowspan="2" class="plan_pic">
    <a href="<$MTEntryPermalink$>"><$MTEntryDataThumbnailImage$></a></td>
    <td class="entry_body"><$MTEntryExcerpt$></td>

    MT generated code for first “image”

     <fieldset class="plan_list">
    	<legend> <a href="http://www.steele-marketing.biz/plans/000.php">Testing</a> (000) </legend>
    	<table>
    		<tr>
    			<td rowspan="2" class="plan_pic"><a href="http://www.steele-marketing.biz/plans/000.php"><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.steele-marketing.biz/122/122-Thumb-100.jpg">View image</a></span></a></td>
    			<td class="entry_body">a few words</td>
    
    

    And MT generated code for second image

     <fieldset class="plan_list">
    	<legend> <a href="http://www.steele-marketing.biz/plans/172005.php">Johnny Jumpup</a> (172.005) </legend>
    	<table>
    		<tr>
    			<td rowspan="2" class="plan_pic"><a href="http://www.steele-marketing.biz/plans/172005.php"><img alt="172.005---thumbnail.jpg" src="http://www.artformhomeplans.com/172/172.005---thumbnail.jpg" width="100" height="70" class="mt-image-left" /></a></td>
    			<td class="entry_body">open plan - laundry on 2nd - island kitchen - garage with bonus</td>
    
    

    If all this is too messy you can download a Word doc with the code and the picture of the problem, at
    http://www.steele-marketing.biz/download/cf_problem.doc .
    You go to the website itself and click on expandables (ie, http://www.steele-marketing.biz/plans/expandables/ ) where the problem will be obvious (and you can "view source" too)

    Thanks
    Lee

  • I guess that instead of using an image custom field, in fact you are using a text single or multiple line field (textarea).

    Is that the case?

    Assuming that is the case, you have to extract the image URL.

    I've coded a plugin for that in the past. Not sure if it works with MT v4.x (it was for v3.x).

    Alternatively you could extract the image with the Brad Choate's Regex and EmbedImage plugins.

  • Hi Mihai, hmmm, this could be it. Yes, the image custom field is the text of its filename. This worked prior to the new custom fields.

    Could you repost your first reply code? It didn't have the angle brackets stripped off either, so the code section is blank. I'd like to replace my code with yours to see it this fixes the problem.

    Assuming this is the problem, why does the existing code work for images entered in prior versions of MT but not the new? I went through many records for many fields in many tables and cannot see a difference between an image entered in the old version and an image entered into the new version...

  • Actually, I checked again. The images fields are definately set to image custom fields, not text.

    Is there a (perhaps new) MT parameter that says to embed an image or display a link to an image?

  • More info.
    With original code that worked in 4.01:

     <$MTEntryDataThumbnailImage$>

    the image was displayed. But any new image asset was displayed as a hyperlinked "view image".

    I changed the code to

     <mt:EntryDataThumbnailImageAsset>
    <img src="<mt:AssetURL />" />
    </mt:EntryDataThumbnailImageAsset>

    and now the new images display. BUT NOW THE OLD IMAGES DON'T...

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