浏览代码

[fix] set title_prefix if set in website settings, fixes frappe/erpnext#4848 (#3294)

* [fix] set title_prefix if set in website settings, fixes frappe/erpnext#4848

* Update context.py
version-14
Rushabh Mehta 8 年前
committed by GitHub
父节点
当前提交
0fbaf93f89
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. +3
    -0
      frappe/website/context.py
  2. +1
    -1
      frappe/website/doctype/website_settings/website_settings.py

+ 3
- 0
frappe/website/context.py 查看文件

@@ -123,6 +123,9 @@ def build_context(context):
app_base = frappe.get_hooks("base_template") app_base = frappe.get_hooks("base_template")
context.base_template_path = app_base[0] if app_base else "templates/base.html" context.base_template_path = app_base[0] if app_base else "templates/base.html"


if context.title_prefix and context.title and not context.title.startswith(context.title_prefix):
context.title = '{0} - {1}'.format(context.title_prefix, context.title)

return context return context


def add_sidebar_data(context): def add_sidebar_data(context):


+ 1
- 1
frappe/website/doctype/website_settings/website_settings.py 查看文件

@@ -83,7 +83,7 @@ def get_website_settings():
settings = frappe.get_doc("Website Settings", "Website Settings") settings = frappe.get_doc("Website Settings", "Website Settings")
for k in ["banner_html", "brand_html", "copyright", "twitter_share_via", for k in ["banner_html", "brand_html", "copyright", "twitter_share_via",
"facebook_share", "google_plus_one", "twitter_share", "linked_in_share", "facebook_share", "google_plus_one", "twitter_share", "linked_in_share",
"disable_signup", "hide_footer_signup", "head_html"]:
"disable_signup", "hide_footer_signup", "head_html", "title_prefix"]:
if hasattr(settings, k): if hasattr(settings, k):
context[k] = settings.get(k) context[k] = settings.get(k)




正在加载...
取消
保存