source: products/qSEOptimizer/trunk/skins/qSEOptimizer/qSEO_Keywords.py

Last change on this file was 79, checked in by chervol, 18 years ago

branch plone2.0.5 fill in

File size: 844 bytes
Line 
1## Script (Python) "listMetaTags"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=Generate Keywords from SEO properties
9##
10
11prop_name = 'qSEO_keywords'
12add_keywords = 'additional_keywords'
13
14keywords = []
15if context.hasProperty(prop_name):
16    keywords = context.getProperty(prop_name)
17
18pprops = context.portal_properties
19sheet = getattr(pprops, 'seo_properties', None)
20if sheet and sheet.hasProperty(add_keywords):
21    keywords += sheet.getProperty(add_keywords)
22
23if keywords:
24    return keywords
25
26accessor = 'Subject'
27
28method = getattr(context, accessor, None)
29if not callable(method):
30    # ups
31    return None
32
33# Catch AttributeErrors raised by some AT applications
34try:
35    value = method()
36except AttributeError:
37    value = None
38
39return value
Note: See TracBrowser for help on using the repository browser.