Skip to content
Permalink
Browse files

Making sure combined tags and categories overview page is created the…

… same way as before.
  • Loading branch information
felixfontein committed Dec 2, 2016
1 parent 8ecfcee commit dbf252a5c4ff5b37911dd98aae2c6ee421c3b815
Showing with 23 additions and 13 deletions.
  1. +23 −13 nikola/plugins/task/taxonomies.py
@@ -170,19 +170,29 @@ def _generate_tag_and_category_overview(self, tag_taxonomy, category_taxonomy, l
tag_context, tag_kw = self._generate_classification_overview_kw_context(tag_taxonomy, lang)
cat_context, cat_kw = self._generate_classification_overview_kw_context(category_taxonomy, lang)

# Combine contexts. We must merge the tag context into the category context
# so that tag_context['items'] makes it into the result.
context = cat_context
context.update(tag_context)
kw = cat_kw
kw.update(tag_kw)

# Update title
title = self.site.MESSAGES[lang]["Tags and Categories"]
context['title'] = title
context['description'] = title
kw['title'] = title
kw['description'] = title
# Combine resp. select dicts
if tag_context['items'] and cat_context['cat_items']:
# Combine contexts. We must merge the tag context into the category context
# so that tag_context['items'] makes it into the result.
context = cat_context
context.update(tag_context)
kw = cat_kw
kw.update(tag_kw)

# Update title
title = self.site.MESSAGES[lang]["Tags and Categories"]
context['title'] = title
context['description'] = title
kw['title'] = title
kw['description'] = title
elif cat_context['cat_items']:
# Use category overview page
context = cat_context
kw = cat_kw
else:
# Use tag overview page
context = tag_context
kw = tag_kw

# Render result
for task in self._render_classification_overview('tag', tag_taxonomy.template_for_classification_overview, lang, context, kw):

0 comments on commit dbf252a

Please sign in to comment.