1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » 2.4 archive problem
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 1684 Views |
-
Re: 2.4 archive problem

15 June 2010 at 10:19am
I switched to Yearly & still 404'ing.
I have two blog modules set up - one called News, the other Blog so don't think it is a naming issue.
Very peculiar.
-
Re: 2.4 archive problem

8 August 2010 at 4:26pm
Have there been any further developments with this issue? Have tried a few fixes and still getting 404's on archive pages.
-
Re: 2.4 archive problem

4 October 2011 at 2:33pm
Ok so here's how I got it working. The urls the archive widgets were creating were like http://mydomain/blogname/year/month. after reading this thread. http://www.silverstripe.org/blog-module-forum/show/7839, I realized what the $allowed_actions were doing which also allowed the calendar, which had a similar functionality to use a /view/year-month url. thinking someone would likely do the same for the blog so I looked at the $allowed_actions in /blog/code/BlogHolder.php and found one called "date" so I added that to the url and it worked. Then i found where the urls were being created and went into blog/code/widgets/ArchiveWidget.php and changed lines 90 - 94 to prepend the "date/" value:
if($isMonthDisplay) {
$link = $container->Link("date/".$sqlResult['Year']) . '/' . sprintf("%'02d", $monthVal);
} else {
$link = $container->Link("date/".$sqlResult['Year']);
}this changed the archive url to http://mydomain/blogname/date/year/month and that worked. i'm not sure if someone built it in and forgot to update the widget or what but hopefully it saves someone else some headscratching time.
| 1684 Views | ||
| Go to Top |

