default userpic

WHY DOES THIS NOT WORK?

Vote 0 Votes

I thought i had this working but i tried it today and it now seems to not work can someone please let me know what i am doing wrong? I really need this to work or im dead in the water.

I want it to show today's entries but if there were no entries today then show me the last 5 entries for today. WHat i did was set up a variable that recorded the entries and then tested that with if else. Why does this not work?



<mt:setvarblock name="entries-today"><mt:Entries days="1"></mt:Entries></mt:setvarblock>
<mt:if name="entries-today" lt="1">
<mt:Entries lastn="5">
<$mt:Include module="NJ-Entry Excerpt"$>
</mt:Entries>
<mt:else>
<h1 class="catagory-list-title">Today's Stories</h1>
<mt:Entries days="1" limit="5">
<$mt:Include module="NJ-Entry Excerpt"$>
</mt:Entries>
</mt:if>


I really need some help with this please.

Reported on Movable Type 4.3

8 Replies

| Add a Reply
  • Exactly what version of MT 4.3 are you running?

  • 4.32

  • Yes, there is a bug in 4.33 that affects queries against date range (and authors). But since it's 4.32, this ain't it. Did you try opening a support ticket?

    Thanks,
    David

  • i just opened a ticket but i am not sure if my logic is sound or if the problem is with movable type. I have tried eveything under the sun to get this to work and nothing seems to do the trick. If anyone knows why this logic does not work or if there is better logic that does work please let me know.

  • It looks like you have an error in your first line of code. It will never output anything, even if there are multiple entries, because you have nothing in the mt:Entries block. You would need to replace this:

    <mt:setvarblock name="entries-today"><mt:Entries days="1"></mt:Entries></mt:setvarblock>
    

    With some code like this:

    <mt:Var name="entries_today" value="0">
    <mt:Entries days="1"><mt:SetVar name="entries_today" op="++"></mt:Entries>
    

    That sets a new variable a 0, then increments it by 1 for each entry that happened in the last day.

  • Have you submitted a support request ticket yet? Has Matt's solution remedied the problem you experienced? Please let us know.

    MT Support

  • We have identified your ticket and we are responding to it.

    MT Support

  • We're working on it with you in Support now. Don't worry. We've got some assistance for you coming.
    MT Support

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