1
Longclaw/W new新手在这里。 W CMS CMS提供了一个可覆盖的get_context方法,可以将字典值传递到模板中。来自documentation:定制Longclaw产品索引
class BlogIndexPage(Page):
...
def get_context(self, request):
context = super(BlogIndexPage, self).get_context(request)
# Add extra variables and return the updated context
context['blog_entries'] = BlogPage.objects.child_of(self).live()
return context
Longclaw是建立在W top顶部的电子商务项目。 Longclaw有一个名为ProductIndex的内置页面模型。有没有办法将变量传递到ProductIndex模板,就像我可以用get_context一样?