Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SOLVED: Blog module with expire date on blog entries

Go to End



Community Member, 49 Posts

27 October 2009 at 3:52am

Edited: 27/10/2009 10:32pm

I have manage to make the blog entries with expiry date. This works just fine, but I have another little problem now. When I use the archive the entries doesn't show because the date on those have expired.

Any ideas on how this can be solved.

Heres the code for the expire date..

In BlogEntires.php

	function ExpiresDoNotShow() {
		$now = strtotime('now');
		if($this->owner->DateOut && strtotime($this->owner->DateOut) < $now) {
			return false;
		} else {
		   return true;


<% if ExpiresDoNotShow %>...<% end_if %>

Add this in the function ExpiresDoNotShow

if (Director::urlParam('Action') && Director::urlParam('Action') != "tag" ) {
return true;