に私はテンプレートタグを追加し、これを管理してきたおかげで...
ないexacly私はwanted..but正常に動作します。
@register.inclusion_tag('tagging/lateral_menu.html', takes_context=True)
def lateral_menu(context):
object = context.get("category") or context.get("product")
if object.__class__.__name__.lower() == "product":
request = context.get("request")
category=lfs.catalog.utils.get_current_product_category(request, object)
else:
category = object
top_category=category
while top_category.parent is not None:
top_category = category.parent
categories =top_category.get_all_children()
return {"category" :category, "top_category" : top_category, "categories" : categories }
テンプレートでは、必要なデータをすべて取得できます。
私はこれを、私のメニューを生成するテンプレートタグを使って管理しています。
sandok
私が最初に望んでいたものではない...