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]
  • #46 / Sep 28, 2007 5:03pm

    Lisa Wess

    20502 posts

    Well, it’s not the date_heading tag pair.  As you can see, the other variables are also not rendering for the most recent month.  But I meant the first entry as going by your weblog parameters.

    So does this:

    {exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_future_entries="yes" display_by="month"  sort="asc" orderby="date" limit="1"}
    {title}
    {/exp:weblog:entries}

    the entry that comes up in that one, does it meet your conditional requirements?

  • #47 / Sep 28, 2007 5:24pm

    ignite

    149 posts

    Well, it’s not the date_heading tag pair.  As you can see, the other variables are also not rendering for the most recent month.  But I meant the first entry as going by your weblog parameters.

    So does this:

    {exp:weblog:entries weblog="events" category="not 33" dynamic="off" show_future_entries="yes" display_by="month"  sort="asc" orderby="date" limit="1"}
    {title}
    {/exp:weblog:entries}

    the entry that comes up in that one, does it meet your conditional requirements?

    No. The very first entry returned by the weblog:entries tag does not meet the conditional requirements of the if statment BUT that’s exactly what I wanted.

    I want any event that starts after today (entry_date > (current_time)) or any event that ends after today (expiration_date > (current_time)) to show. I don’t want the first entry that the weblog:entries tag returns to me. Just the entries that meet the above conditions.

    The first entry that meets those conditions (titled: A Funny Thing Happened on the way to the FORUM, start date: 9/28, end date: 9/29) doesn’t run the date_heading tag like it should.

    I hope that was more clear. 😊

  • #48 / Sep 28, 2007 5:48pm

    Lisa Wess

    20502 posts

    That was more clear.  I think what is happening is that the conditional is comparing against each entry - and since the date_heading shows over the first entry, it is not appearing.  Do you need the date_heading inside the conditional like that?

  • #49 / Sep 28, 2007 5:59pm

    ignite

    149 posts

    That was more clear.  I think what is happening is that the conditional is comparing against each entry - and since the date_heading shows over the first entry, it is not appearing.

    That makes sense! (edit: nope still confused :down: ) But I’m not sure how to get around that? I can’t think of another way to get the result set I want using the weblog:entries tag. Should I perhaps be using the Query Module tags and the date_heading tag within that?

    Do you need the date_heading inside the conditional like that?

    Yes, only because otherwise it will show the date_heading from each month then which isn’t what I want. I only want the current month and forward.

  • #50 / Sep 28, 2007 6:03pm

    Lisa Wess

    20502 posts

    Oh! I understand. You shouldn’t use conditionals for that, though, you should use the start_on parameter.

  • #51 / Sep 28, 2007 6:10pm

    ignite

    149 posts

    I tried that first and it wouldn’t bring back anything that started before today’s date that also end’s after today’s date.

    Edit: If today falls within the range I want that entry to still show.

  • #52 / Sep 28, 2007 6:14pm

    Lisa Wess

    20502 posts

    I’m not following what the problem was with the start_on parameter.  Did you try it from the current_time as recommended in the docs? The way that you’re doing it with conditionals will limit the *display* but not the entries, which is going to lead to more problems like the 3 page one here. =)

  • #53 / Sep 28, 2007 6:22pm

    ignite

    149 posts

    I’m not following what the problem was with the start_on parameter.  Did you try it from the current_time as recommended in the docs?

    Yes I did it exactly as the docs described but the problem was it didn’t get any entries whose entry_date was before the current_time.

    The way that you’re doing it with conditionals will limit the *display* but not the entries, which is going to lead to more problems like the 3 page one here. =)

    The conditionals were introduced after I couldn’t get it to work with simply the “start_on” parameter of the weblog:entries tag.

  • #54 / Sep 28, 2007 6:26pm

    Lisa Wess

    20502 posts

    ignite - so the problem is that you want all entries to show, from yesterday onwards?  Or from when?

  • #55 / Sep 28, 2007 7:57pm

    ignite

    149 posts

    ignite - so the problem is that you want all entries to show, from yesterday onwards?  Or from when?

    No. The simple answer is “I don’t know”. It varies.

    Each event has a “start date” == {entry_date} and “end date” == {expiration_date} option. If the event is only one day then no “end date” is entered. The number of days varies from event to event. So an event whose “start date” is 9/25 and whose “end date” is 10/3 will need to be visible until the event has passed. It’s not a problem to show events which are only one day. The start_on parameter would work in that instance. But when you have a date range it gets more complicated. I don’t know how many days back the start_on parameter would have to be set since each event ranges in how many days it is.

    I hope that helps.

  • #56 / Sep 28, 2007 8:04pm

    Lisa Wess

    20502 posts

    Have you considered the Repeet module? I understand that it handles spanning.

  • #57 / Oct 01, 2007 11:55am

    ignite

    149 posts

    Yes, I considered it. In fact I tried to get it going back when the project was first being developed but for lack of time and knowledge regarding the repeet module, I opted for what I thought was a simpler solution.

    So here’s what I’ve taken from our discussion here:

    1) When using {current_time} in an if statement you need the curly brackets around the variable name. (Is this documented somewhere? If so I must have missed this.) Can I ask, why is this the exception to the rule?

    2) {date_heading} works right except the way I want to use it. It’s not a bug but simply doesn’t work. (I’m still not clear on why though.)

    3) For date spanning use the Repeet Module by Mr. Wilson.

    Does that sum it up?

  • #58 / Oct 01, 2007 12:54pm

    Lisa Wess

    20502 posts

    1) Because current_time is not normally available in a conditional, we need it as a variable to make it available.

    2) There is no problem with date_heading; the problem, which we clearly demonstrated in the tests, is with your conditionals.  If you had no conditionals, the date_heading would always work. Anything you put in the conditionals does not show up for the first iteration because of how it is comparing.  This is not a bug -this is the conditional displaying exactly what and when you told it to

    3) Yes, but it’s a plugin currently. =)

  • #59 / Oct 01, 2007 7:16pm

    ignite

    149 posts

    1) Because current_time is not normally available in a conditional, we need it as a variable to make it available.

    OK. That makes sense. Is it safe to assume that it will be added to next version of EE as a standard conditional variable?

    1)2) There is no problem with date_heading; the problem, which we clearly demonstrated in the tests, is with your conditionals.  If you had no conditionals, the date_heading would always work. Anything you put in the conditionals does not show up for the first iteration because of how it is comparing.  This is not a bug -this is the conditional displaying exactly what and when you told it to.

    Hmmm… I think {date_heading} should evaluate only what gets passed to it, there by reacting to the first entry it encounters regardless if it wasn’t the first entry the weblog:entries tag found. Yes, I got the results/data I wanted but {date_heading} should, in my opinion, trigger based on that first record encountered. To me {date_heading}, in this case, knows too much about what the weblog:entries tag returned and is reacting, or lack there of, before it’s being asked to.

    3) Yes, but it’s a plugin currently. =)

    Oops, my bad. 😉

  • #60 / Oct 01, 2007 7:50pm

    Lisa Wess

    20502 posts

    OK. That makes sense. Is it safe to assume that it will be added to next version of EE as a standard conditional variable?

    Why would you assume that? You’re welcome to put it as a feature request; but it works perfectly well now within the {}.

    As far as date_heading: you’re asking ExpressionEngine to read your mind instead of reading the code.  I don’t mean to argue with you but this is really, really important.  ExpressionEngine can do only what you tell it.  We don’t make assumptions, and you’ve encased it within a conditional that is telling everything inside that conditional not to display in this instance. It doesn’t matter if it’s the date_heading code or the text “pink elephants rock”. 

    If you want it to work *differently* then you should limit, not by conditionals, but by parameters; or consider writing a plugin specific to your project.

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

ExpressionEngine News!

#eecms, #events, #releases