Changeset 1308 in products for quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/viewlets.py
- Timestamp:
- Sep 11, 2009 5:23:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/viewlets.py
r1265 r1308 49 49 return u"%s\n%s"%(qseo_title, qseo_comments) 50 50 51 class HTTPEquiv(ViewletBase):52 53 def charset( self ):54 context = self.context.aq_inner55 site_properties = getToolByName( context, 'portal_properties').site_properties56 return site_properties.getProperty('default_charset', 'utf-8')57 58 def render( self ):59 return """<meta http-equiv="Content-Type" content="text/html; charset=%s" />"""%self.charset()60 61 class BaseUrlViewlet( ViewletBase ):62 """63 simpel viewlet for base href rendering64 """65 def renderBase( self ):66 # returns correct base href67 context = self.context.aq_inner68 isFolder = getattr(context.aq_explicit, 'isPrincipiaFolderish', 0)69 base_url = context.absolute_url()70 71 # when accessing via WEBDAV you're not allowed to access aq_explicit72 try:73 return isFolder and '%s/'%base_url or base_url74 except (Unauthorized, 'Unauthorized'):75 pass76 77 def render( self ):78 return """<base href="%s" /><!--[if lt IE 7]></base><![endif]-->"""% self.renderBase()51 #class HTTPEquiv(ViewletBase): 52 # 53 # def charset( self ): 54 # context = self.context.aq_inner 55 # site_properties = getToolByName( context, 'portal_properties').site_properties 56 # return site_properties.getProperty('default_charset', 'utf-8') 57 # 58 # def render( self ): 59 # return """<meta http-equiv="Content-Type" content="text/html; charset=%s" />"""%self.charset() 60 # 61 #class BaseUrlViewlet( ViewletBase ): 62 # """ 63 # simpel viewlet for base href rendering 64 # """ 65 # def renderBase( self ): 66 # # returns correct base href 67 # context = self.context.aq_inner 68 # isFolder = getattr(context.aq_explicit, 'isPrincipiaFolderish', 0) 69 # base_url = context.absolute_url() 70 # 71 # # when accessing via WEBDAV you're not allowed to access aq_explicit 72 # try: 73 # return isFolder and '%s/'%base_url or base_url 74 # except (Unauthorized, 'Unauthorized'): 75 # pass 76 # 77 # def render( self ): 78 # return """<base href="%s" /><!--[if lt IE 7]></base><![endif]-->"""% self.renderBase() 79 79 80 80 class MetaTagsViewlet( ViewletBase ): … … 92 92 93 93 metaTags = SortedDict() 94 metaTags.update(pu.listMetaTags(context))94 #metaTags.update(pu.listMetaTags(context)) 95 95 metadataList = [ 96 96 ('seo_description', 'description'), … … 100 100 101 101 if exposeDCMetaTags: 102 metadataList.append((' qSEO_Distribution', 'DC.distribution'))102 metadataList.append(('seo_distribution', 'DC.distribution')) 103 103 104 104 seo_context = getMultiAdapter((self.context, self.request), name='seo_context')
Note: See TracChangeset
for help on using the changeset viewer.