ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom field displays on all entries apart from 1?

November 29, 2010 5:27pm

Subscribe [2]
  • #1 / Nov 29, 2010 5:27pm

    We have about 50 entries in a weblog. We recently added a new custom field to that weblog and added it into the template.

    The new custom field displays on all entry pages apart from one of them, as if by random.

    I tried deleting the entry and then publishing a new one and then deleting the cache, but still no luck, for that very same entry even though it’s been re-published.

    Running EE 1.6.9 Build:  20100805

  • #2 / Nov 30, 2010 3:05am

    John Henry Donovan

    12339 posts

    Uncommon Knowledge,

    What type of custom field is it?

    Can you share your weblog tags with us?
    Have you got a link to your site?

    If you try and hardcode the entry_id of that one entry into your weblog tag does it work?

  • #3 / Nov 30, 2010 3:56pm

    The custom field type is a textarea with the name “moreinfo”. The site is not online as of yet (to the public anyway) but I can show you the (toned down) template code if that is any help:

    {exp:weblog:entries weblog="cards" limit="1"}
    
    <h1>{title}</h1>
    
    {embed="embeds/_social"}
    
    {title} is spoken in the following countries: {countries}
    
    {if moreinfo}
        {moreinfo}
    {/if}
    
    {if cardpdf}
    
        <a href="http://{cardpdf}" target="_blank" rel="noopener">{site_url}images/uploads/pdf_button.gif</a>
        <a href="http://{cardpdf}" target="_blank" rel="noopener">Download PDF of this {title} gluten free card here</a>
    
    {/if}
    
    {cardimage}
    
    {if hirescard}
    <a href="http://{hirescard}" target="_blank" rel="noopener">Click here to view this card in high resolution.</a>
    {/if}
    
    {/exp:weblog:entries}
  • #4 / Dec 01, 2010 2:49am

    John Henry Donovan

    12339 posts

    Uncommon Knowledge,

    It would be better syntax to write your conditionals this way. Can you create a blank template and only add the following. What happens if you hard code the entry_id in there?

    {exp:weblog:entries weblog="cards" limit="1"}
    
    <h1>{title}</h1>
    
    {if moreinfo != ""}
        {moreinfo}
    {/if}
    
    
    {/exp:weblog:entries}
  • #5 / Dec 01, 2010 4:09pm

    Hello John

    Thank you for your response. I created a new template and added the above code. I also tried hard-coding the entry_id=“601” into the the new template code and it worked.

    However, when I try it in my current template, the custom field still does not display for entry_id 601 (i have changed the ‘if’ statement and hard-coded the entry_id in the live template).

    I"m guessing something in my main/live template is stopping the custom field from showing, but why only on one entry instead of all the entries?

    Many thanks,
    Uncommon Knowledge

  • #6 / Dec 02, 2010 10:18am

    Sue Crocker

    26054 posts

    Uncommon Knowledge, I don’t know why that’s happening, but simplifying the template and adding back in complexity is the only way to track down why it’s happening.

  • #7 / Jan 24, 2011 5:56pm

    After bashing my head against the wall, I realised the problem was in our /system/cache/ folder. Whenever I cleared the cache in the EE Utilities menu, it said it had done it successfully, I had always taken it’s word.

    Now checking in the /cache/ folder there’s still a heap of stuff in there. Deleted it all, refreshed the entry and Voila!

    Thanks for the help guys, this can safely be closed 😉

  • #8 / Jan 25, 2011 10:53am

    Sue Crocker

    26054 posts

    Glad you were able to figure out what the problem was. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases