source: products/qSEOptimizer/trunk/skins/qSEOptimizer/qSEO_CustomMetaTags.py @ 1459

Last change on this file since 1459 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1## Script (Python) "qSEO_CustomMetaTags"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=Return context's properties prefixed with qSEO_custom_
9##
10
11result = []
12added = []
13property_prefix = 'qSEO_custom_'
14for property, value in context.propertyItems():
15    idx = property.find(property_prefix)
16    if idx == 0 and len(property) > len(property_prefix):
17        added.append(property[len(property_prefix):])
18        result.append({'meta_name'    : property[len(property_prefix):],
19                       'meta_content' : value})
20
21from Products.CMFCore.utils import getToolByName
22site_properties = getToolByName(context, 'portal_properties')
23if hasattr(site_properties, 'seo_properties'):
24    names = getattr(site_properties.seo_properties, 'default_custom_metatags', [])
25    for name in names:
26        if name not in added:
27            result.append({'meta_name'    : name,
28                           'meta_content' : ''})
29
30return result
Note: See TracBrowser for help on using the repository browser.