// Get implemented Get method for HomeRouter. func (this *PostListRouter) Category() { this.TplNames = "post/category.html" slug := this.GetString(":slug") cat := models.Category{Slug: slug} if err := cat.Read("Slug"); err != nil { this.Abort("404") return } pers := 25 qs := models.Posts().Filter("Category", &cat) qs = this.postsFilter(qs) cnt, _ := models.CountObjects(qs) pager := this.SetPaginator(pers, cnt) qs = qs.OrderBy("-Created").Limit(pers, pager.Offset()).RelatedSel() var posts []models.Post models.ListObjects(qs, &posts) this.Data["Posts"] = posts this.Data["Category"] = &cat this.Data["CategorySlug"] = cat.Slug this.Data["IsCategory"] = true var cats []models.Category this.setCategories(&cats) var topics []models.Topic this.setTopicsOfCat(&topics, &cat) }