1
ロングクロワ/ Wagtail初心者はこちら。 Wagtail CMSは、辞書値をテンプレートに渡すことを可能にするオーバーライド可能なget_contextメソッドを提供します。 documentation:Longclaw ProductIndexのカスタマイズページ
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は、Wagtailの上に構築された電子商取引プロジェクトです。 LongclawにはProductIndexというページモデルが組み込まれています。変数をProductIndexテンプレートに渡す方法はありますか?get_contextを使用することができますか?