Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/configure.zcml
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/configure.zcml	(revision 1309)
+++ quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/configure.zcml	(revision 1313)
@@ -8,36 +8,4 @@
         manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
         class=".viewlets.TitleCommentViewlet"
-        layer=".interfaces.IPloneSEOLayer"
-        permission="zope2.View"
-        />
-       
-    <!--browser:viewlet
-        name="quintagroup.seoptimizer.http_equiv"
-        manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
-        class=".viewlets.HTTPEquiv"
-        layer=".interfaces.IPloneSEOLayer"
-        permission="zope2.View"
-        /-->
-
-    <!--browser:viewlet
-        name="quintagroup.seoptimizer.base"
-        manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
-        class=".viewlets.BaseUrlViewlet"
-        layer=".interfaces.IPloneSEOLayer"
-        permission="zope2.View"
-        /-->
-
-    <!--browser:viewlet
-        name="quintagroup.seoptimizer.generator"
-        manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
-        template="templates/generator.pt"
-        layer=".interfaces.IPloneSEOLayer"
-        permission="zope2.View"
-        /-->
-
-    <browser:viewlet
-        name="quintagroup.seoptimizer.metatags"
-        manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
-        class=".viewlets.MetaTagsViewlet"
         layer=".interfaces.IPloneSEOLayer"
         permission="zope2.View"
Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/keywords.py
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/keywords.py	(revision 1309)
+++ quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/keywords.py	(revision 1313)
@@ -16,5 +16,4 @@
     def validateKeywords(self, text):
         """ see interface """
-
         # extract keywords from text
         if not text.strip():
Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/generator.pt
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/generator.pt	(revision 1309)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<meta name="generator" content="Plone - http://plone.org" />
Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/seo_controlpanel.pt
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/seo_controlpanel.pt	(revision 1309)
+++ quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/seo_controlpanel.pt	(revision 1313)
@@ -45,4 +45,18 @@
                             <textarea cols="60" id="default_custom_metatags" name="default_custom_metatags" rows="15"
                                       tal:content="python:'\n'.join(view.getDefaultCustomMetatags())"></textarea>
+                        </div>
+                    </div>
+
+                    <div class="field">
+                        <label for="metatags_order" i18n:translate="label_metatags_order">
+                            Meta tags order in the page.
+                        </label>
+                        <div class="formHelp" i18n:translate="help_metatags_order">
+                            Fill in meta tags order (one per line) which will appear on qseo_properties
+                            edit tab. Example: "metaname accessor".
+                        </div>
+                        <div class="widget">
+                            <textarea cols="60" id="metatags_order" name="metatags_order" rows="15"
+                                      tal:content="python:'\n'.join(view.getMetaTagsOrder())"></textarea>
                         </div>
                     </div>
Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/viewlets.py
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/viewlets.py	(revision 1309)
+++ quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/viewlets.py	(revision 1313)
@@ -1,11 +1,8 @@
 from cgi import escape
 from zope.component import getMultiAdapter
-from zope.viewlet.interfaces import IViewlet
 from Products.CMFPlone.utils import safe_unicode
 from plone.app.layout.viewlets.common import ViewletBase
 from Products.CMFCore.utils import getToolByName
-from AccessControl import Unauthorized
-from quintagroup.seoptimizer.util import SortedDict
-from quintagroup.seoptimizer.interfaces import IKeywords 
+
 
 class TitleCommentViewlet(ViewletBase):
@@ -49,94 +46,4 @@
                 return u"%s\n%s"%(qseo_title, qseo_comments)
 
-#class HTTPEquiv(ViewletBase):
-#    
-#    def charset( self ):
-#        context = self.context.aq_inner
-#        site_properties = getToolByName( context, 'portal_properties').site_properties
-#        return site_properties.getProperty('default_charset', 'utf-8')
-#    
-#    def render( self ):
-#        return """<meta http-equiv="Content-Type" content="text/html; charset=%s" />"""%self.charset()
-#         
-#class BaseUrlViewlet( ViewletBase ):
-#    """
-#       simpel viewlet for base href rendering
-#    """
-#    def renderBase( self ):
-#        # returns correct base href
-#        context = self.context.aq_inner
-#        isFolder = getattr(context.aq_explicit, 'isPrincipiaFolderish', 0)
-#        base_url = context.absolute_url()
-#
-#        # when accessing via WEBDAV you're not allowed to access aq_explicit
-#        try:
-#            return isFolder and '%s/'%base_url or base_url
-#        except (Unauthorized, 'Unauthorized'):
-#            pass
-#
-#    def render( self ):
-#        return """<base href="%s" /><!--[if lt IE 7]></base><![endif]-->"""% self.renderBase()
-
-class MetaTagsViewlet( ViewletBase ):
-
-    def listMetaTags( self ):
-        context = self.context.aq_inner
-        portal_props = getToolByName(context, 'portal_properties')
-        pu = getToolByName(context, 'plone_utils')
-        seo_props = getToolByName(portal_props, 'seo_properties', None)
-        if seo_props is None:
-            return pu.listMetaTags(context)
-
-        site_props = getToolByName(portal_props, 'site_properties')
-        exposeDCMetaTags = site_props.exposeDCMetaTags
-
-        metaTags = SortedDict()
-        #metaTags.update(pu.listMetaTags(context))
-        metadataList = [
-            ('seo_description', 'description'),
-            ('seo_keywords',    'keywords'),
-            ('seo_robots',      'robots'),
-            ('seo_distribution','distribution')]
-
-        if exposeDCMetaTags:
-            metadataList.append(('seo_distribution', 'DC.distribution'))
-
-        seo_context = getMultiAdapter((self.context, self.request), name='seo_context')
-        for accessor, key in metadataList:
-            method = getattr(seo_context, accessor, None)
-            if not callable(method):
-                # ups
-                continue
-            # Catch AttributeErrors raised by some AT applications
-            try:
-                value = method()
-            except AttributeError:
-                value = None
-
-            if not value:
-                continue
-            if isinstance(value, (tuple, list)):
-                value = ', '.join(value)
-
-            metaTags[key] = value
-
-        # add custom meta tags (added from qseo tab by user) for given context and default from configlet
-        custom_meta_tags = seo_context.seo_customMetaTags()
-        for tag in custom_meta_tags:
-            if tag['meta_content']:
-                metaTags[tag['meta_name']] = tag['meta_content']
-
-        # Set the additional matching keywords, if any
-        adapter = IKeywords(context, None)
-        if adapter is not None:
-            keywords = adapter.listKeywords()
-            if keywords:
-                metaTags['keywords'] = keywords
-
-        return metaTags
-
-    def render( self ):
-        return '\n'.join([safe_unicode("""<meta name="%s" content="%s" />"""%(name, content)) \
-                                       for name, content in self.listMetaTags().items()])
 
 class CustomScriptViewlet( ViewletBase ):
@@ -148,5 +55,5 @@
         if seo_props is None:
             return '' 
-	return seo_props.getProperty('custom_script', '')
+        return seo_props.getProperty('custom_script', '')
 
     def render( self ):
@@ -162,3 +69,2 @@
         seo_context = getMultiAdapter((self.context, self.request), name='seo_context')
         return """<link rel="canonical" href="%s" />""" % seo_context.seo_canonical()
-
Index: quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py
===================================================================
--- quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py	(revision 1309)
+++ quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py	(revision 1313)
@@ -217,5 +217,5 @@
         sp = self.portal_properties.site_properties
         return sp.getProperty('exposeDCMetaTags')
-    
+
     def getDefaultCustomMetatags( self ):
         """
@@ -223,4 +223,10 @@
         seo = self.portal_properties.seo_properties
         return seo.getProperty('default_custom_metatags')
+
+    def getMetaTagsOrder( self ):
+        """
+        """
+        seo = self.portal_properties.seo_properties
+        return seo.getProperty('metatags_order')
 
     def getAdditionalKeywords( self ):
@@ -250,4 +256,5 @@
         additionalKeywords=request.get('additionalKeywords', [])
         default_custom_metatags=request.get('default_custom_metatags', [])
+        metatags_order=request.get('metatags_order', [])
 
         site_props = getToolByName(self.portal_properties, 'site_properties')
@@ -261,4 +268,5 @@
             seo_props.manage_changeProperties(additional_keywords=additionalKeywords)
             seo_props.manage_changeProperties(default_custom_metatags=default_custom_metatags)
+            seo_props.manage_changeProperties(metatags_order=metatags_order)
 
             for ptype in self.portal_types.objectValues():
