pgovers / oscar-wagtail-demo

A Django recipe for integration Wagtail into an Oscar application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Explanation about template ingeration Wagtail (menu) and Oscar

bobslee opened this issue · comments

Hi,
I have a question about the following:

The root-url (without any path) shows a page which consists 2 components:

  • A primary (top) nav/menu which also lists some Wagtail pages
  • Oscar parts (nav/menu, left categories, and inner product listing)

Please could you explain to me how this - template integration - works?
I can't figure out. Not even with the django-debug-toolbar, which shows the several templates which get loaded.

  • Is it just the configuration and ordering in: urls.py and the ROOT_URLCONF (in settings)?
  • Or via template extending. But how gets the Oscar context (data) via Wagtail into the Oscar template(s)?

I would really appreciate your answer.

Hi @bobslee
in this Demo we show both the wagtail menu and Oscar navigation.
As you can see in this page we extend the oscar catalogue browse page: {% extends "catalogue/browse.html" %} and load the wagtail navigation block:

{% block navigation %}
    {% get_site_root as site_root %}
    {% top_menu parent=site_root calling_page=self %}
    {{ block.super }}
{% endblock %}

This is done only to show both the Oscar and Wagtail menus. In your own site we would not recommend using this approach.

Kind regards, Henk-Jan

Hi @Henk-JanVanHasselaar
Thanks for the clue ;) and clear explanation.

Kind regards, Bob