Changeset 1671 in products for quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py
- Timestamp:
- Feb 9, 2010 12:59:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py
r1647 r1671 11 11 12 12 from quintagroup.seoptimizer import SeoptimizerMessageFactory as _ 13 from quintagroup.seoptimizer import interfaces 13 14 14 15 SEPERATOR = '|' 15 HAS_CANONICAL_PATH = True16 16 SEO_PREFIX = 'seo_' 17 17 PROP_PREFIX = 'qSEO_' 18 18 SUFFIX = '_override' 19 19 PROP_CUSTOM_PREFIX = 'qSEO_custom_' 20 21 try:22 from quintagroup.canonicalpath.interfaces import ICanonicalPath23 except ImportError:24 HAS_CANONICAL_PATH = False25 20 26 21 class SEOContext( BrowserView ): … … 213 208 """ Generate canonical URL from SEO properties. 214 209 """ 215 canonical = self.getSEOProperty( 'qSEO_canonical' ) 216 217 if not canonical and HAS_CANONICAL_PATH: 218 canpath = queryAdapter(self.context, ICanonicalPath) 219 if canpath: 220 purl = getToolByName(self.context, 'portal_url')() 221 cpath = canpath.canonical_path() 222 canonical = purl + cpath 223 224 return canonical and canonical or self.context.absolute_url() 210 purl = getToolByName(self.context, 'portal_url')() 211 canpath = queryAdapter(self.context, interfaces.ICanonicalPath, 212 name='qseo_canonical') 213 return purl + canpath.canonical_path() 225 214 226 215
Note: See TracChangeset
for help on using the changeset viewer.