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.

date_heading not showing...

September 21, 2007 3:43pm

Subscribe [1]
  • #16 / Sep 21, 2007 5:14pm

    ignite

    149 posts

    Updated 😊

  • #17 / Sep 21, 2007 5:22pm

    Lisa Wess

    20502 posts

    Hey look, it works.  Can you look at it, you know the data, and tell me if it’s returning the correct and expected responses, ignite?

    Once you confirm that, we need to get all of that into a single conditional, correct?

  • #18 / Sep 21, 2007 5:24pm

    Lisa Wess

    20502 posts

    Oh, while you’re at it - the ones that show expiration_date as 0 - those have no expiration date set, correct?

  • #19 / Sep 21, 2007 5:40pm

    ignite

    149 posts

    Hey look, it works.  Can you look at it, you know the data, and tell me if it’s returning the correct and expected responses, ignite?

    Once you confirm that, we need to get all of that into a single conditional, correct?

    well the evaluation of entry_date > current_time is wrong.

    Yeah the 0 are due to the expiration_date not being added to the records.

  • #20 / Sep 21, 2007 5:43pm

    Lisa Wess

    20502 posts

    Ok, how about we get a more readable example up there?  But I think we’ve narrowed the problem, right? It’s not evaluating the way you expected?

    format=”%D, %F %d, %Y - %g:%i:%s”

    {exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_future_entries="yes" display_by="month" limit="18" sort="asc" orderby="date"}  
    <b>entry_date</b>: {entry_date format="%D, %F %d, %Y - %g:%i:%s"}
    
    <b>current_time</b>: {current_time format="%D, %F %d, %Y - %g:%i:%s"}
    
    <b>expiration_date</b>: {expiration_date format="%D, %F %d, %Y - %g:%i:%s"}
    
    <hr >
    {if entry_date > current_time}
    <h2>conditional 1: is the entry date greater than the current time?</h2>
    <p><b>yes!</b> the entry date is greater than the current time</p>
    
    <p>{/if}<br />
    {if expiration_date > current_time}</p><h2>conditional  2: is the expiration date greater than the current time?</h2>
    <p><b>yes!</b>the expiration date is greater than the current time</p>
    
    <p>{/if}<br />
    ***<br />
    {/exp:weblog:entries}

    Update the template with that, please =)

  • #21 / Sep 21, 2007 5:51pm

    ignite

    149 posts

    updated 😊

    Edit:

    entry_date: Mon, November 13, 2006 - 10:30:00

    Shouldn’t be evaluating to greater than…

    current_time: Fri, September 21, 2007 - 2:47:50

  • #22 / Sep 21, 2007 6:10pm

    Lisa Wess

    20502 posts

    So if you reverse the signs by using < - do you get the results you want?  Just humor me and give it a shot, please? =)

  • #23 / Sep 21, 2007 6:13pm

    ignite

    149 posts

    No, now none of the conditionals evaluate to true. They all evaluate to false.

  • #24 / Sep 21, 2007 6:21pm

    Lisa Wess

    20502 posts

    Ok, I’m going to ask for some help on this one, because between dates and conditionals, and staring at that template, I just need some fresh eyes.  I recommend taking a break, walking around, maybe work on something else.  Fresh perspective can help a ton.

    And switch those signs back to evaluating true for now, even if they shouldn’t. =)

  • #25 / Sep 21, 2007 6:25pm

    ignite

    149 posts

    Sounds good! I put the template back. Here’s the code I’m using for that test template:

    {exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_future_entries="yes" display_by="month" limit="18" sort="asc" orderby="date"}  
    <hr >
    <b>count:</b>: {count}
    
    <b>title</b>: {title}
    
    <b>entry_date</b>: {entry_date format="%D, %F %d, %Y - %g:%i:%s"}
    
    <b>current_time</b>: {current_time format="%D, %F %d, %Y - %g:%i:%s"}
    
    <b>expiratoin_date</b>: {expiration_date format="%D, %F %d, %Y - %g:%i:%s"}
    
    ---
    {if entry_date > current_time}
    <h2>conditional 1: is the entry date greater than the current time?</h2>
    <p><b>yes!</b> the entry date is greater than the current time</p>
    
    <p>{/if}<br />
    {if expiration_date > current_time}</p><h2>conditional  2: is the expiration date greater than the current time?</h2>
    <p><b>yes!</b>the expiration date is greater than the current time</p>
    
    <p>{/if}<br />
    <hr ><br />
    {/exp:weblog:entries}

  • #26 / Sep 21, 2007 8:36pm

    Lisa Wess

    20502 posts

    Ok, try this for me.  With *just* current_time, use {current_time}, and let us see if that helps.

  • #27 / Sep 21, 2007 9:15pm

    ignite

    149 posts

    ok that works but that’s basically what i started with. I was getting the results I wanted but there was a conflict with the date_header in that it wasn’t triggering the date header and therefore leaving out part of the HTML needed to style the page.

    Here’s that live page again so you can see what I mean.

    And here’s that code for that page: (Notice I used the entry_date > {current_time} like you just requested.)

    <h4>Jump to Month</h4>
    
    <p>{exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_future_entries="yes" display_by="month" limit="18" sort="asc" orderby="date"}  <!-- start_on="{current_time format='%Y-%m-%d %g:%i %A'}" show_expired="yes" --><br />
        {if entry_date > {current_time} OR expiration_date > {current_time}}<br />
        {date_heading display="monthly"}<a href="#{entry_date" class="jump">{entry_date format="%F %Y"}</a>{/date_heading}                            <br />
        {/if}<br />
    {/exp:weblog:entries}</p>
    
    <p><br />
    {exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_expired="yes" show_future_entries="yes" display_by="month" limit="18" sort="asc" orderby="date"}<br />
        <br />
    {if entry_date > {current_time} OR expiration_date > {current_time}}<br />
        {if sticky == 'y'}<br />
            {date_heading display="daily"}<br />
            <div class="sticky"><br />
                </p><h4>Featured Dates</h4>
    <p>        {/date_heading}<br />
                <span>{entry_date format="%m/%d/%Y"}</span> <a href="http://{path=community/event/{url_title}}">{title}</a><br />
            {date_footer display="daily"}</div>{/date_footer}<br />
        {/if}<br />
        <br />
        {if sticky == 'n'}<br />
        {date_heading display="monthly"}<dl id="{entry_date format="%F_%Y"}" class="month_view"><dt>{entry_date format="%F %Y"}</dt>{/date_heading}<br />
        <dd><br />
            <span>{entry_date format="%n/%j"}{if expiration_date != 0} – {expiration_date format="%n/%j"}{/if} </span><br />
            <a href="http://{path=community/event/{url_title}}">{title}</a><br />
        </dd><br />
        {date_footer display="monthly"}</dl>{/date_footer}<br />
        {/if}<br />
    {/if}<br />
        <br />
    {/exp:weblog:entries}

    Notice on that linked page that October and beyond seems to work fine but September’s events aren’t displayed properly. That’s cuz date_header never gets triggered for September.

  • #28 / Sep 24, 2007 12:31pm

    ignite

    149 posts

    Hi Lisa, hopefully taking the time to enjoy the weekend and clearing our minds will help us resolve this issue. Do you think there’s an problem with the current_time variable when evaluated in conditionals? Also, I’m still not sure why the date heading won’t show for September events. I still think it has to do with that first record but I can’t be sure.

    Were you able to get some fresh eyes to look at this?

  • #29 / Sep 26, 2007 3:11pm

    Lisa Wess

    20502 posts

    This is the date_heading part that is not working, correct?

    {if entry_date > {current_time} OR expiration_date > {current_time}}
        {date_heading display="monthly"}<a href="#{entry_date" class="jump">{entry_date format="%F %Y"}</a>{/date_heading}                            
        {/if}

    Can you try breaking that up, see if it works with only ONE conditional?  You might even replace the date_heading with say “THIS IS A TEST” - to try to determine if it’s date_heading or the conditional that is failing.

  • #30 / Sep 26, 2007 6:11pm

    ignite

    149 posts

    I tried both conditions separately and the date_header still failed to work.

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

ExpressionEngine News!

#eecms, #events, #releases