def fourth_level_page(request, parent_slug, secondary_slug, third_slug, slug, navigation_node_id, template_name='core/page.html'): navigationNode = NavigationNode.objects.get(id=navigation_node_id) secondaryNavigation = NavigationNode.objects.filter(parentNode__slug=parent_slug) thirdNavigation = NavigationNode.objects.filter(parentNode__slug=secondary_slug) contentItems = Content.objects.filter(navigationNode__id=navigationNode.id).order_by('-createdDate') return render_with_context(request, template_name, { 'navigationNode' : navigationNode, 'breadcrumb': navigationNode.get_breadcrumb(), 'secondaryNavigation' : secondaryNavigation, 'thirdNavigation' : thirdNavigation, 'contentItems' : contentItems })
def first_level_page(request, slug, template_name='core/recent-updates.html'): navigationNode = NavigationNode.objects.get(slug=slug) secondaryNavigation = NavigationNode.objects.filter(parentNode__slug=slug) contentItems = Content.objects.filter( Q(navigationNode__parentNode__parentNode__id=navigationNode.id) | Q(navigationNode__parentNode__parentNode__parentNode__id=navigationNode.id)).order_by('-createdDate')[:5] return render_with_context(request, template_name, { 'navigationNode' : navigationNode, 'breadcrumb': None, 'secondaryNavigation' : secondaryNavigation, 'contentItems' : contentItems })
def second_level_page(request, parent_slug, slug, navigation_node_id, template_name='core/recent-updates.html'): navigationNode = NavigationNode.objects.get(id=navigation_node_id) secondaryNavigation = NavigationNode.objects.filter(parentNode__id=navigationNode.parentNode.id) thirdNavigation = NavigationNode.objects.filter(parentNode__id=navigationNode.id) contentItems = Content.objects.filter( Q(navigationNode__parentNode__id=navigationNode.id) | Q(navigationNode__parentNode__parentNode__id=navigationNode.id)).order_by('-createdDate')[:5] return render_with_context(request, template_name, { 'navigationNode' : navigationNode, 'breadcrumb': navigationNode.get_breadcrumb(), 'secondaryNavigation' : secondaryNavigation, 'thirdNavigation' : thirdNavigation, 'contentItems' : contentItems })
def default(request, template_name='core/default.html'): contentItems = Content.objects.all().order_by('-createdDate')[:5] return render_with_context(request, template_name, { 'contentItems' : contentItems })