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.

Calendar - accessing date information within not_entries

February 26, 2012 10:03am

Subscribe [2]
  • #1 / Feb 26, 2012 10:03am

    tidy

    196 posts

    I’m using EE 2.4 build 20120123
    In the calendar tag, I’m trying to use the day_path or date variables within {if not_entries} but they won’t parse?

    {!--this works fine--}
    {if entries}
    <td class="{switch}"><a href="http://{day_path=events/view}">{day_number}</a></td>
    {/if}
    
    {!-- day_path unparsed within not_entries and including {date format='%Y'} here results in no output for all blank cells --}
    {if not_entries}
    <td class="{switch}"><a href="http://{day_path=events/view}">{day_number}</a></td>
    {/if}

    I’m trying to link each date in the calendar to template-group/template/yy/mm/dd regardless of whether the date has entries with that entry date or not - is this possible?

     

  • #2 / Feb 27, 2012 12:24pm

    Shane Eckert

    7174 posts

    Hello Janine,

    I am sorry to hear you are running into this snag. I am unable to replicate this right now, so I would like to check the entire template.

    Can you include the code for the entire template?

    Is this an embedded template or a snippet? If so, can you show me where it’s called and the code that is around it? Feel free to replace your domain with example.com where needed.

    Looking forward your response.

    Cheers,

  • #3 / Feb 27, 2012 12:56pm

    tidy

    196 posts

    Hi Shane,

    Thanks for replying. I’ve done up a bare bones template to replicate. Here is the full code:

    {exp:channel:calendar switch="calendarToday|calendarCell" start_day="monday" channel="exhibitions|events" show_expired="yes" show_future_entries="yes" month="{current_time format='%m'}" year="{current_time format='%Y'}"}
    
    <table class="calendar-month">
    <tr class="calendarHeader">
    <th colspan="5">{date format="%F"}</th>
    <th colspan="2"><div class="calendarMonthLinks"><a href="http://{previous_path=events/view}">/interface/images/arrow_left.png</a><a href="http://{next_path=events/view}">/interface/images/arrow_right.png</a></div></th>
    </tr>
    <tr>
    {calendar_heading}
    <td class="calendarDayHeading">{lang:weekday_abrev}</td>
    {/calendar_heading}
    </tr>
    
    {calendar_rows}
    {row_start}<tr>{/row_start}
    
    {if entries}
    <td class="{switch}"><a href="http://{day_path=events/view}">{day_number}</a></td>
    {/if}
    {!--day_path remains unparsed for dates without entries--}
    {if not_entries}
    <td class="{switch}"><a href="http://{day_path=events/view}">{day_number}</a></td>
    {/if}
    {if blank}
    <td class="calendarBlank"></td>
    {/if}
    {row_end}</tr>{/row_end}
    {/calendar_rows}
    </table>
    {/exp:channel:calendar}
  • #4 / Feb 27, 2012 7:08pm

    Sean C. Smith

    3818 posts

    Hi Tidy,

    I looked at the docs for day_path and this is what it says.

    This variable will be replaced by a URL designed to show all entries from the specified day. Typically, the path should be for your main Template that shows your multiple entries. For example, this:

    This suggests that if there are no entries this variable will not work.

    Sean

  • #5 / Feb 28, 2012 4:47am

    tidy

    196 posts

    Thanks for replying Sean - yes, I figured it just wasn’t possible which is a shame, but we have managed a (clunky) workaround where the URL for the no entry days is built working off either current_time or url segments (when the current month is not being viewed). I’ll put in a feature request and I might get lucky someday 😊

  • #6 / Feb 28, 2012 5:24pm

    Shane Eckert

    7174 posts

    Hello tidy,

    I am glad to hear you were able to get a workaround setup.

    Is there anything else I can help you with?

    Cheers,

  • #7 / Feb 28, 2012 5:33pm

    tidy

    196 posts

    Hi Shane, that’s the lot for now thanks so you can close this off - sorry meant to add that in my earlier reply

  • #8 / Feb 28, 2012 5:55pm

    Shane Eckert

    7174 posts

    Hey tidy,

    Now worries!

    Have a great week.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases