Changeset 1041 in products


Ignore:
Timestamp:
Apr 22, 2009 12:23:08 PM (17 years ago)
Author:
koval
Message:

tag cloud now has good links when not rendered in blog; changed default width and height for better look

Location:
quintagroup.portlet.cumulus/trunk/quintagroup/portlet/cumulus
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.portlet.cumulus/trunk/quintagroup/portlet/cumulus/catalog.py

    r1039 r1041  
    1111        portal_properties = getToolByName(self.context, 'portal_properties') 
    1212        self.default_charset = portal_properties.site_properties.getProperty('default_charset', 'utf-8') 
     13        portal = getToolByName(context, 'portal_url').getPortalObject() 
     14        self.portal_url = portal.absolute_url() 
    1315 
    1416    def getTags(self, number=None): 
     
    2325            except TypeError: 
    2426                number_of_entries = 1 
    25             tags.append((name.decode(self.default_charset), number_of_entries, '#')) 
     27            name = name.decode(self.default_charset) 
     28            url = '%s/search?Subject:list=%s' % (self.portal_url, name) 
     29            tags.append((name, number_of_entries, url)) 
    2630 
    2731        return tags 
  • quintagroup.portlet.cumulus/trunk/quintagroup/portlet/cumulus/cumulusportlet.py

    r1039 r1041  
    2424        description=_(u'Width in pixels (500 or more is recommended).'), 
    2525        required=True, 
    26         default=550) 
     26        default=152) 
    2727 
    2828    height = schema.Int( 
     
    3030        description=_(u'Height in pixels (ideally around 3/4 of the width).'), 
    3131        required=True, 
    32         default=375) 
     32        default=152) 
    3333 
    3434    tcolor = schema.TextLine( 
     
    108108    implements(ICumulusPortlet) 
    109109 
    110     width    = 550; 
    111     height   = 375; 
     110    width    = 152; 
     111    height   = 152; 
    112112    tcolor   = u'5391d0' 
    113113    tcolor2  = u'333333' 
     
    159159        params = self.getParams() 
    160160        return """<script type="text/javascript"> 
    161             var so = new SWFObject("%(url)s", "tagcloudflash", "%(width)s", "%(height)s", "9", "#%(bgcolor)s"); 
    162             %(trans)s 
    163             so.addParam("allowScriptAccess", "always"); 
    164             so.addVariable("tcolor", "0x%(tcolor)s"); 
    165             so.addVariable("tcolor2", "0x%(tcolor2)s"); 
    166             so.addVariable("hicolor", "0x%(hicolor)s"); 
    167             so.addVariable("tspeed", "%(tspeed)s"); 
    168             so.addVariable("distr", "%(distr)s"); 
    169             so.addVariable("mode", "%(mode)s"); 
    170             so.addVariable("tagcloud", "%(tagcloud)s"); 
    171             so.write("comulus"); 
    172         </script>""" % params 
     161                var so = new SWFObject("%(url)s", "tagcloudflash", "%(width)s", "%(height)s", "9", "#%(bgcolor)s"); 
     162                %(trans)s 
     163                so.addParam("allowScriptAccess", "always"); 
     164                so.addVariable("tcolor", "0x%(tcolor)s"); 
     165                so.addVariable("tcolor2", "0x%(tcolor2)s"); 
     166                so.addVariable("hicolor", "0x%(hicolor)s"); 
     167                so.addVariable("tspeed", "%(tspeed)s"); 
     168                so.addVariable("distr", "%(distr)s"); 
     169                so.addVariable("mode", "%(mode)s"); 
     170                so.addVariable("tagcloud", "%(tagcloud)s"); 
     171                so.write("comulus"); 
     172            </script>""" % params 
    173173 
    174174    def getParams(self): 
Note: See TracChangeset for help on using the changeset viewer.