plugin blog static: added background parameter, to set an image

This commit is contained in:
Goffi 2018-01-22 08:36:36 +01:00
commit c09a5feb3c

View file

@ -44,29 +44,32 @@ PLUGIN_INFO = {
class StaticBlog(object):
params = """
params = u"""
<params>
<individual>
<category name="%(category_name)s" label="%(category_label)s">
<param name="%(title_name)s" label="%(title_label)s" value="" type="string" security="0"/>
<param name="%(banner_name)s" label="%(banner_label)s" value="" type="string" security="0"/>
<param name="%(keywords_name)s" label="%(keywords_label)s" value="" type="string" security="0"/>
<param name="%(description_name)s" label="%(description_label)s" value="" type="string" security="0"/>
<category name="{category_name}" label="{category_label}">
<param name="{title_name}" label="{title_label}" value="" type="string" security="0"/>
<param name="{banner_name}" label="{banner_label}" value="" type="string" security="0"/>
<param name="{background_name}" label="{background_label}" value ="" type="string" security="0"/>
<param name="{keywords_name}" label="{keywords_label}" value="" type="string" security="0"/>
<param name="{description_name}" label="{description_label}" value="" type="string" security="0"/>
</category>
</individual>
</params>
""" % {
'category_name': C.STATIC_BLOG_KEY,
'category_label': D_(C.STATIC_BLOG_KEY),
'title_name': C.STATIC_BLOG_PARAM_TITLE,
'title_label': D_('Page title'),
'banner_name': C.STATIC_BLOG_PARAM_BANNER,
'banner_label': D_('Banner URL'),
'keywords_name': C.STATIC_BLOG_PARAM_KEYWORDS,
'keywords_label': D_('Keywords'),
'description_name': C.STATIC_BLOG_PARAM_DESCRIPTION,
'description_label': D_('Description'),
}
""".format(
category_name = C.STATIC_BLOG_KEY,
category_label = D_(C.STATIC_BLOG_KEY),
title_name = C.STATIC_BLOG_PARAM_TITLE,
title_label = D_('Page title'),
banner_name = C.STATIC_BLOG_PARAM_BANNER,
banner_label = D_('Banner URL'),
background_name = u"Background",
background_label = D_(u"Background image URL"),
keywords_name = C.STATIC_BLOG_PARAM_KEYWORDS,
keywords_label = D_('Keywords'),
description_name = C.STATIC_BLOG_PARAM_DESCRIPTION,
description_label = D_('Description'),
)
def __init__(self, host):
try: # TODO: remove this attribute when all blogs can be retrieved