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.

Entry date shows only sometimes

June 13, 2012 2:31pm

Subscribe [1]
  • #1 / Jun 13, 2012 2:31pm

    mxchic

    7 posts

    I have a template that multiple users post to that should have the entry dates show on the bottom. Only on some pages it does show others it is blank. I have tried the following:

    <center><font size="1" face="arial"> 
    Last Update: {exp:last_updated format="%F %d, %Y"}
    Edit Date: {edit_date format="%Y %m %d"}
    Entry Date: {entry_date format="%Y %m %d"} 

    This is inside the exp:channel:entries tag.  If the admin post an entry the date shows up, if any one else post it does not show up.

    Is there something wrong with the code or does the level of access have something to do with it showing up or not showing up?

    Thanks,

  • #2 / Jun 14, 2012 11:16am

    Dan Decker

    7338 posts

    Hi mxchic,

    Thanks for bringing your question to the forums!

    With the nature of the issue being related to access levels, it’s important for us to get the context of the overall template.

    Can you post the code for the whole template?

    Also, what is this tag?

    {exp:last_updated format="%F %d, %Y"}

    That’s not a native ExpressionEngine tag, is it related to a plugin?

    I look forward to your reply!

    Cheers,

     

  • #3 / Jun 14, 2012 1:42pm

    mxchic

    7 posts

    Should have given a few more details on that one.  It is not a native EE tag it comes out of the plug in by Alex Kendrick called Last Updated. I have narrowed down the problem to EE being able to identify which entry to pull the info from so here is what I have now:

    <div id="mainContent">
    
       {exp:channel:entries channel="channelname" limit="1" track_views="two"}
        {content}
    {/exp:channel:entries}   
     {exp:channel:entries channel="channelname" limit="1"}
        {image}
      {main_content}
    
    This entry has been viewed {view_count_two} times.
    {/exp:channel:entries} 
    {exp:channel:entries entry_id="{segment_3}"} {if segment_3 == "category"} category_name="{segment_4}%"{/if}
     Last edited {edit_date format="%F %j, %Y"}
    {/exp:channel:entries}

    This works great if the entry is pulled by the number of the entry pulls by category it is blank and pulls nothing. Can’t get count to work either but that is another issue.

    Thanks

  • #4 / Jun 17, 2012 10:17pm

    Dan Decker

    7338 posts

    Hi mxchic,

    I’m a bit confused why you are using 3 channel entries tag pairs?

    Can you explain to me how the 3 are related? There may be a way we can simplify this.

    And this bit:

    {if segment_3 == "category"} category_name="{segment_4}%"{/if}

    Do yo mean to use this conditional inside the channel entries parameters?

    I look forward to your reply.

    Cheers,

  • #5 / Jun 18, 2012 9:15am

    mxchic

    7 posts

    I should have clarified. The first two pull from two different channels. The third is really a pull based on the url that is being pulled. There is probably an easier way to do that but this worked. The last pull is just to get the edited date. I put that in as a third pull so I could pull from either of the first two.

    There is probably a much easier way to do this than the way I have gone about it but being a newbie on a short launch time I had to do whatever I could get to work. Any help would be appreciated.

    Thanks,

  • #6 / Jun 19, 2012 5:38pm

    Dan Decker

    7338 posts

    Hi mxchic,

    So, I guess I should have come to this sooner - but the edit date will only have a value if the entry has ever been edited. If the entry has never been edited in the Control Panel, then that value would be empty.

    I bet that explains the inconsistencies?

    Sorry we went all down the rabbit hole on this one!

    Take note of an entry that doesn’t display the edit date, then make a small change to that entry in the Control Panel. After making a change, visit it again on the front of the site. Does the edit date contain a value?

    Cheers,

  • #7 / Jul 10, 2012 10:20am

    mxchic

    7 posts

    That makes perfect sense. I did not even think about that.

    Thanks for the help!

  • #8 / Jul 11, 2012 12:47pm

    Dan Decker

    7338 posts

    Hi mxchic,

    My pleasure!

    If you need anything else, please let me know.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases