Ignore:
Timestamp:
Jun 1, 2011 3:38:29 PM (13 years ago)
Author:
vmaksymiv
Message:

fixed getting canonical url property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py

    r3141 r3224  
    6565                                                 'Subject', ()), 
    6666            "seo_keywords": self.getSEOProperty('qSEO_keywords', default=()), 
    67             "seo_canonical": self.getCanonical(), 
     67            "seo_canonical": self.getSEOProperty(CANONICAL_PROPERTY), 
    6868            # Add test properties 
    6969            "has_seo_title": self.context.hasProperty('qSEO_title'), 
     
    158158        return result 
    159159 
     160    # Not used 
    160161    def getCanonical(self): 
    161         canonical = queryAdapter(self.context, ICanonicalLink) 
    162         return canonical and canonical.canonical_link or "" 
     162        # TODO: rewrite function structure 
     163        if self.context.hasProperty(CANONICAL_PROPERTY): 
     164            canonical = queryAdapter(self.context, ICanonicalLink) 
     165            return canonical and canonical.canonical_link or "" 
     166        return "" 
    163167 
    164168 
Note: See TracChangeset for help on using the changeset viewer.