Skip to content

Commit

Permalink
Specify tag page title and other plugin page title (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix authored Nov 20, 2023
1 parent d0195c1 commit 3ea515d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qgis-app/plugins/templatetags/plugin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ def klass(ob):
def plugin_title(context):
"""Returns plugin name for title"""
title = ""

if "title" in context:
title = context["title"]
if "plugin" in context:
title = context["plugin"].name
if "version" in context:
title = "{plugin} {version}".format(
plugin=context["version"].plugin.name, version=context["version"].version
)
if "page_title" in context:
title = context["page_title"]
return title
1 change: 1 addition & 0 deletions qgis-app/plugins/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ def get_context_data(self, **kwargs):
context.update(
{
"title": _("Plugins tagged with: %s") % unquote(self.kwargs["tags"]),
"page_title": _("Tag: %s") % unquote(self.kwargs["tags"])
}
)
return context
Expand Down

0 comments on commit 3ea515d

Please sign in to comment.