misc: add new category redirect option (#8218)
This commit is contained in:
parent
683adbfb53
commit
f1b53040e3
|
@ -81,4 +81,4 @@ wcs.admin.settings.SettingsDirectory._q_exports.append('domino')
|
|||
import wcs.categories
|
||||
wcs.categories.Category.XML_NODES = [('name', 'str'), ('url_name', 'str'),
|
||||
('description', 'str'), ('position', 'int'),
|
||||
('homepage_position', 'str'), ('limit', 'int')]
|
||||
('homepage_position', 'str'), ('redirect_url', 'str'), ('limit', 'int')]
|
||||
|
|
|
@ -47,6 +47,10 @@ class CategoryUI:
|
|||
form.add(IntWidget, 'limit',
|
||||
title=_('Limit number of items displayed on homepage'),
|
||||
value=self.category.get_limit())
|
||||
form.add(StringWidget, 'redirect_url', size=32,
|
||||
title=_('URL Redirection'),
|
||||
hint=_('If set, redirect the site category page to the given URL.'),
|
||||
value=self.category.redirect_url)
|
||||
|
||||
form.add_submit('submit', _('Submit'))
|
||||
form.add_submit('cancel', _('Cancel'))
|
||||
|
@ -68,6 +72,7 @@ class CategoryUI:
|
|||
category.description = form.get_widget('description').parse()
|
||||
category.homepage_position = form.get_widget('homepage_position').parse()
|
||||
category.limit = form.get_widget('limit').parse()
|
||||
category.redirect_url = form.get_widget('redirect_url').parse()
|
||||
|
||||
category.store()
|
||||
|
||||
|
|
Reference in New Issue