We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Mini Calendar - daily post list - 404 not found?

How Do I?

NikiW's avatar
NikiW
19 posts
11 years ago
NikiW's avatar NikiW

I’ve been searching for several hours in the forums for this issue, and while I see similar, I’m not quite seeing the exact problem I’m having, unless it’s just sailing over my head this week.

I set up a mini calendar exactly like the help docs said, and it does show a link when there is a post for a specific date.

But when I click on that URL, which looks like this:

http://www.mysite.com/eengine/index.php/blog/2015/01/06

It generates a 404 not found.

The monthly archives work fine, and the only difference with the URL is the last two digits:

http://www.mysite.com/eengine/index.php/blog/2015/01

Is there some other extra template I need to create to get it to show the posts for that specific day? Some setting in the admin panel that I missed?

Thanks.

       
Boyink!'s avatar
Boyink!
5,011 posts
11 years ago
Boyink!'s avatar Boyink!

It wouldn’t be a setting - this is all template/code/linking.

You are using the {day_path} variable?

Can you post the EE code generating the links?

Do you have anything in your .htaccess? Any 404 logic in the blog templates>?

       
NikiW's avatar
NikiW
19 posts
11 years ago
NikiW's avatar NikiW

It’s ironic that you’re the one to reply, I used your eBook to set up the bulk of the site. 😊

Yes, there is logic for 404 pages, and yes I’m using day_path. I copied the code for the mini calendar from the Docs page exactly, and changed out the channel variables for my site’s set up.

(edited to add…) there is no .htaccess in my eengine directory.

From my “embeds/footer_widgets” template, where the calendar is. I also added the status part in my troubleshooting, thinking it wasn’t automatically detecting the default statuses (no customs used).

<div id="footer-widgets" class="footer-widgets">
 <div class="wrap">
  <div class="footer-widgets-1 widget-area">
   <div id="calendar-2" class="widget widget_calendar">
   <div class="widget-wrap">
   <h4 class="widgettitle">What's the date?</h4>
   <div id="calendar_wrap">
   {exp:channel:calendar switch="calendarToday|calendarCell" channel="blog|portfolio" status="open|closed"}
   <table id="wp-calendar" border="0" cellpadding="6" cellspacing="1" summary="My Calendar">
   <tr class="calendarHeader">
   <th><div class="calendarMonthLinks"><a href="http://{previous_path=blog/index}"><<</a></div></th>
   <th colspan="5">{date format="%F %Y"}</th>
   <th><div class="calendarMonthLinks"><a href="http://{next_path=blog/index}class=calendarMonthLinks">>></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}' align='center'><a href="http://{day_path=blog/index}">{day_number}</a></td>
   {/if}

   {if not_entries}
   <td class='{switch}' align='center'>{day_number}</td>
   {/if}

   {if blank}
   <td class='calendarBlank'>{day_number}</td>
   {/if}

   {row_end}</tr>{/row_end}
   {/calendar_rows}
   </table>
   {/exp:channel:calendar}
   </div>
   </div>
   </div>
  </div>

And some pieces from my “blog/index” template, showing the 404 code at the top, with the center parts clipped out, and showing the embed at the bottom for the footer:

{if segment_4 != ""}
  {redirect="site/404"}
{/if}
{embed="embeds/html_header" my_page_title="Home"}
{embed="embeds/page_header" the_url_title="blog" my_location="home"}

<SNIP>

{embed="embeds/footer_widgets"}

{snp_footer}

I also just realized that moving forward or backward through the months in the calendar reloads the entire page, and makes it suddenly become that month’s archive page, rather than just moving the calendar ahead/back and leaving it on the main index page, or whatever page it happens to be displaying at the time. Since I haven’t really messed with this very much since setting it up, I don’t know if this is expected behavior or if there is something else that needs to be added or changed to get it to simply cycle through the mini calendar rather than refreshing the whole page. Probably something for another time, one problem at a time… 😊

       
Boyink!'s avatar
Boyink!
5,011 posts
11 years ago
Boyink!'s avatar Boyink!

I think it’s your 404 code:

{if segment_4 != ""}
  {redirect="site/404"}
{/if}

The day number loads in segment 4.

Try removing the 404 temporarily or changing it to segment_5 instead.

       
NikiW's avatar
NikiW
19 posts
11 years ago
NikiW's avatar NikiW

Awesome. That was it! Time to go change the other templates where that is set.

The other thing I saw, I now realize is expected behavior after comparing it to a non-EE CMS that also does a calendar. I’m sure there is probably some way to get the calendar to be the only thing that changes on the page using javascript or php, but that is more than I care to really worry about at the moment. I’m just glad the daily page is now showing up.

Thanks!

       
Boyink!'s avatar
Boyink!
5,011 posts
11 years ago
Boyink!'s avatar Boyink!

Not all templates will need the same segment value in the 404 code. It all depends on what URL the template is loaded at. Blog templates tend to have more URL types that are valid than other templates.

But glad to hear it’s fixed.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.