<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0">

    <channel>

        <title>Blog</title>
        <link>http://www.coresoftwaregroup.com/blog</link>
        <description>Let's try this again.  A whole bunch of years ago, I tried doing some blogging, and it didn't go so hot.  Now, Core Software Group is doing a lot of exciting work with Plone 3, and we are documenting various tips and tricks that we run into as we build custom Plone CMS solutions for our customers.</description>

        <generator>basesyndication</generator>
        <!-- TODO
        <lastBuildDate>Mon, 30 Sep 2002 11:00:00 GMT</lastBuildDate>
        <copyright>Copyright 1997-2002 Dave Winer</copyright>
        <docs>http://backend.userland.com/rss</docs>
        <category domain="Syndic8">1765</category>
        <managingEditor>dave@userland.com</managingEditor>
        <webMaster>dave@userland.com</webMaster>
        -->

        <!-- TODO: Should there be an individual image associatable with each
        Weblog object?  I think so... -->
        <image>
            <title>Blog</title>
            <url>http://www.coresoftwaregroup.com/logo.png</url>
            <link>http://www.coresoftwaregroup.com/blog</link>
        </image>

        
            <item>
                <title>Injecting Plone variables into javascript</title>
                <guid>http://www.coresoftwaregroup.com/blog/injecting-plone-variables-into-javascript</guid>
                <link>http://www.coresoftwaregroup.com/blog/injecting-plone-variables-into-javascript</link>
                <description>
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Step 1: Create a class to output the javascript&lt;/h3&gt;
&lt;p&gt;I created a file in src/my.product/my/product/browser called 
CommonUtils.py and added a class GlobalJS with a __call__ method that 
returns a string containing the javascript. __call__ sets the 
content-type, creates the string containing the variable, and returns 
the string.&lt;/p&gt;
&lt;pre&gt;class GlobalJS(BrowserView):
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __call__(self,REQUEST,RESPONSE):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RESPONSE.setHeader('Content-Type', 'application/javascript')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; js_string = "var portal_url = '%s';" % (self.context.portal_url())
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return js_string&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Step 2: Create a browser view pointing to the class&lt;/h3&gt;
&lt;p&gt;In src/my.product/my/product/browser/configure.zcml, I added a 
browser view pointing to GlobalJS, gave it a name, and added a 
permission. Note that the name of the file containing GlobalJS is 
CommonUtils.py&lt;/p&gt;
&lt;pre&gt;&amp;lt;browser:view 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for="*"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="global_js.js" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class=".CommonUtils.GlobalJS"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; permission="zope2.View"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Step 3: Register the view in javascript registry&lt;/h3&gt;
&lt;p&gt;Here, I register the browser view in 
src/my.product/my/product/profiles/default/jsregistry.xml. I needed 
access to portal_url before jquery was loaded, so I added the 
insert-before property. Note that the id is the same as the name 
registered in the browser view.&lt;/p&gt;
&lt;pre&gt;&amp;lt;javascript 
&amp;nbsp;&amp;nbsp;&amp;nbsp; id="global_js.js"
&amp;nbsp;&amp;nbsp;&amp;nbsp; cacheable="True" compression="safe" cookable="True"
&amp;nbsp;&amp;nbsp;&amp;nbsp; enabled="True" expression=""&amp;nbsp; inline="True" insert-before="jquery.js"/&amp;gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now, global_js.js is loaded on every page and I have access to 
portal_url from within javascript.&lt;/p&gt;
&lt;p&gt;Hope this helps someone.&lt;/p&gt;
</description>
                <author>Mike Cullerton</author>

                
                    <category>jsregistry</category>
                
                
                    <category>plone 3</category>
                
                
                    <category>generic setup</category>
                
                
                    <category>browser view</category>
                

                <pubDate>Tue, 22 Jun 2010 09:00:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>Colorado World Plone Day - 2010</title>
                <guid>http://www.coresoftwaregroup.com/blog/colorado-world-plone-day-2010</guid>
                <link>http://www.coresoftwaregroup.com/blog/colorado-world-plone-day-2010</link>
                <description>&lt;p&gt;This year's Colorado World Plone Day event will be held at the National Renewable Energy Laboratory's (NREL) Visitors Center in beautiful Golden, Colorado, and will be presented as part of NREL's Power Lunch series.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Colorado World Plone Day Logo" class="image-left" src="../colorado-world-plone-day-2010/wpd.png" /&gt;Presenters will talk about various features of Plone, demo websites using Plone, and field any questions people may have.&lt;/p&gt;
&lt;p&gt;So far, this year's presenters are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kurt Bendl - Contractor at NREL&lt;/li&gt;
&lt;li&gt; Dan Timmons - CU, Boulder&lt;/li&gt;
&lt;li&gt;Chris Crownhart - Core Software Group&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;/ul&gt;
&lt;p&gt;The presentations will last from approximately 12:00pm - 12:45pm, followed by a 15 minute question/answer period.&lt;/p&gt;
&lt;p&gt;For those of you who need to get back to work, we will break shortly.  For those of you who wish to stick around to see some developer oriented presentations, and/or to discuss Plone's features in more depth, we will have the room for a couple more hours.&lt;/p&gt;
&lt;p&gt;Direction to the NREL Visitors Center can be found at: &lt;a class="external-link" href="http://www.nrel.gov/visitors_center/contact_visit.html"&gt;http://www.nrel.gov/visitors_center/contact_visit.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Power Lunch series is a brown bag style presentation series, so please bring a sandwich and come hang out with us for an hour.&lt;/p&gt;
&lt;p&gt;For more information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;See: &lt;a class="external-link" href="../colorado-world-plone-day-2010/colorado-world-plone-day"&gt;http://www.coresoftwaregroup.com/colorado-world-plone-day-2010&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Contact Chris Crownhart at 303/809-1001&lt;/li&gt;
&lt;/ul&gt;</description>
                <author>Chris Crownhart</author>

                
                    <category>Meeting</category>
                
                
                    <category>Social Event</category>
                
                
                    <category>community</category>
                
                
                    <category>worldploneday</category>
                
                
                    <category>presentation</category>
                

                <pubDate>Mon, 19 Apr 2010 13:20:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>Overriding the Title tag in Plone 3</title>
                <guid>http://www.coresoftwaregroup.com/blog/overriding-the-title-tag-in-plone-3</guid>
                <link>http://www.coresoftwaregroup.com/blog/overriding-the-title-tag-in-plone-3</link>
                <description>&lt;h2&gt;Quick Overview&lt;/h2&gt;
&lt;p&gt;You need to override the &lt;b&gt;plone.htmlhead.title&lt;/b&gt; viewlet and &lt;b&gt;create a class&lt;/b&gt; to render your title. The default version of the viewlet is defined in [eggs]/plone/app/layout/&lt;b&gt;configure.zcml&lt;/b&gt;, and the class is defined in &lt;b&gt;common.py&lt;/b&gt;. You'll need a few more things from common.py too. Override the viewlet in your own [theme]/browser/configure.zcml file, and add the location of your new class.&lt;/p&gt;
&lt;h2&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;I needed to override a viewlet, but didn't know which one. A quick grep found a reference to the plone.htmlhead viewlet manager, and then one to the plone.htmlhead.title viewlet. Viewlets are found in the plone/app/layout/viewlets/configure.zcml file within the eggs area of your buildout. Here is the specific code in configure.zcml.&lt;/p&gt;
&lt;pre&gt;...&lt;br /&gt;    &amp;lt;browser:viewlet&lt;br /&gt;       name="plone.htmlhead.title"&lt;br /&gt;       manager=".interfaces.IHtmlHead"&lt;br /&gt;       class=".common.TitleViewlet"&lt;br /&gt;       permission="zope2.View"&lt;br /&gt;       /&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;In this case, the plone.htmlhead.title viewlet references a class called .common.TitleViewlet. This means a file--in the same directory as configure.zcml, named common.py contains a class named TitleViewlet. Here is the TitleViewlet code from common.py.&lt;/p&gt;
&lt;pre&gt;class TitleViewlet(ViewletBase):&lt;br /&gt; &lt;br /&gt; ...&lt;br /&gt;&lt;br /&gt; def index(self):&lt;br /&gt;     portal_title = safe_unicode(self.portal_title())&lt;br /&gt;     page_title = safe_unicode(self.page_title())&lt;br /&gt;     if page_title == portal_title:&lt;br /&gt;         return u"&amp;lt;title&amp;gt;%s&amp;lt;/title&amp;gt;" % (escape(portal_title))&lt;br /&gt;     else:&lt;br /&gt;         return u"&amp;lt;title&amp;gt;%s &amp;amp;mdash; %s&amp;lt;/title&amp;gt;" % (&lt;br /&gt;                  escape(safe_unicode(page_title)),&lt;br /&gt;                  escape(safe_unicode(portal_title)))&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;In the index method at the bottom, Plone sets the value of the &amp;lt;title&amp;gt; tag.&lt;/p&gt;
&lt;p&gt;If the page title and the portal title are the same, the portal title is used. If not, both are used, with page title on the left and portal title on the right.&lt;/p&gt;
&lt;p&gt;We needed to switch it, so that portal title was on the left, and page title was on the right.&lt;/p&gt;
&lt;h2&gt;What we did&lt;/h2&gt;
&lt;p&gt;To override the title viewlet, I created an entry in my theme's browser/configure.zcml file.&lt;/p&gt;
&lt;pre&gt;&amp;lt;!-- Our custom title viewlet --&amp;gt; &lt;br /&gt; &amp;lt;browser:viewlet&lt;br /&gt; name="plone.htmlhead.title"&lt;br /&gt; manager="plone.app.layout.viewlets.interfaces.IHtmlHead"&lt;br /&gt; class=".myTitleViewlet.TitleViewlet" &lt;br /&gt; layer=".interfaces.IThemeSpecific"&lt;br /&gt; permission="zope2.View" &lt;br /&gt; /&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Notice that there is a new layer statement, and that the manager line includes the complete path to IHtmlHead. The class statement now points to our new class containing code to override the title.&lt;/p&gt;
&lt;p&gt;Here is the code from myTitleViewlet.py.&lt;/p&gt;
&lt;pre&gt;from zope.interface import implements&lt;br /&gt;from zope.component import getMultiAdapter&lt;br /&gt;from zope.viewlet.interfaces import IViewlet&lt;br /&gt;from zope.deprecation.deprecation import deprecate&lt;br /&gt;&lt;br /&gt;from Products.CMFPlone.utils import safe_unicode&lt;br /&gt;from Products.Five.browser import BrowserView&lt;br /&gt;from cgi import escape&lt;br /&gt;&lt;br /&gt;from plone.app.layout.viewlets.common import ViewletBase&lt;br /&gt;&lt;br /&gt;class TitleViewlet(ViewletBase):&lt;br /&gt;&lt;br /&gt; ...&lt;br /&gt;&lt;br /&gt; def index(self):&lt;br /&gt; portal_title = safe_unicode(self.portal_title())&lt;br /&gt; page_title = safe_unicode(self.page_title())&lt;br /&gt; if page_title == portal_title:&lt;br /&gt; return u"&amp;lt;title&amp;gt;%s&amp;lt;/title&amp;gt;" % (escape(portal_title))&lt;br /&gt; else:&lt;br /&gt; return u"&amp;lt;title&amp;gt;%s | %s&amp;lt;/title&amp;gt;" % (&lt;br /&gt; escape(safe_unicode(portal_title)),&lt;br /&gt; escape(safe_unicode(page_title)))&lt;/pre&gt;
&lt;p&gt;I needed some of the imports from the top of common.py, and added one of my own for ViewletBase. The only code that really changed is the else clause, where the order of portal_title and page_title are switched, and the em dash is replaced by a pipe (|).&lt;/p&gt;
&lt;p&gt;A great reference for overriding the &amp;lt;title&amp;gt; tag is &lt;a href="http://plone.org/documentation/manual/theme-reference/elements/hiddenelements/plone.htmlhead.title"&gt;HTML Head Title&lt;/a&gt; page which is part of the &lt;a href="http://plone.org/documentation/manual/theme-reference"&gt;Plone Theme Reference&lt;/a&gt;.&lt;/p&gt;</description>
                <author>Mike Cullerton</author>

                
                    <category>plone 3</category>
                
                
                    <category>TitleViewlet</category>
                
                
                    <category>plone.app.layout</category>
                
                
                    <category>viewlet</category>
                

                <pubDate>Tue, 26 Jan 2010 12:20:00 -0700</pubDate>

                
            </item>
        
        
            <item>
                <title>Installing plone 3 using paster</title>
                <guid>http://www.coresoftwaregroup.com/blog/installing-plone-3-using-paster</guid>
                <link>http://www.coresoftwaregroup.com/blog/installing-plone-3-using-paster</link>
                <description>&lt;p&gt;We build most of our sites using paster (versus using the Unified Installer). Here are some simple notes we had for doing that (&lt;a href="http://plone.org/documentation/how-to/use-paster" target="_blank"&gt;more information on using paster with plone can be found in the Plone documentation&lt;/a&gt;):&lt;/p&gt;
&lt;p&gt;&lt;i&gt;This how-to assumes you have ZopeSkel installed.&lt;/i&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a directory to house the plone installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;mkdir /path/to/plone/install/directory&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt; Use paster to install buildout files.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;paster create -t plone3_buildout /path/to/plone/install/directory&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Change your working directory to the new zope install.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;cd /path/to/zope/install/directory&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Bootstrap the system.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;python bootstrap.py&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Run buildout.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;./bin/buildout&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;That's it.  Now, just start zope/plone.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;./bin/instance start&lt;br /&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Or run in it the foreground (and in debug mode).&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;./bin/instance fg&lt;/pre&gt;</description>
                <author>Mike Cullerton</author>

                
                    <category>ZopeSkel</category>
                
                
                    <category>plone 3</category>
                
                
                    <category>paster</category>
                

                <pubDate>Thu, 10 Sep 2009 17:30:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>Migrating portal_status_message to addPortalMessage for Plone 3</title>
                <guid>http://www.coresoftwaregroup.com/blog/migrating-portal_status_message-to-cookies-for-plone-3</guid>
                <link>http://www.coresoftwaregroup.com/blog/migrating-portal_status_message-to-cookies-for-plone-3</link>
                <description>&lt;p&gt;This is a pretty simple change, but I could not find much documentation on it around the web.  We had quite a few controller python scripts that had code in them setting a portal_status_message.  The code looked like:&lt;/p&gt;
&lt;pre&gt;return state.set(portal_status_message='Your comment has been sent to the web support team.')&lt;/pre&gt;
&lt;p&gt;This old code is completely ignored now, so you have to convert these to the new format.&lt;/p&gt;
&lt;p&gt;In Plone 3, portal_status_message is now handled using a cookie, and there are special classes and methods for adding your messages to the cookie.&lt;/p&gt;
&lt;p&gt;Now, to set a status message, do the following:&lt;/p&gt;
&lt;pre&gt;from Products.CMFPlone import PloneMessageFactory as _&lt;br /&gt;context.plone_utils.addPortalMessage(_(u'Your comment has been sent to the web support team.'))&lt;/pre&gt;
&lt;p&gt;Additionally, you can pass flags to the method to indicate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; 'info'&lt;/li&gt;
&lt;li&gt;'warning'&lt;/li&gt;
&lt;li&gt;'error' &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;like:&lt;/p&gt;
&lt;pre&gt;context.plone_utils.addPortalMessage(_(u'Your comment has been sent to the web support team.'), 'info')&lt;/pre&gt;
&lt;p&gt;For more information about the classes, interfaces, and methods, see this PLIP: &lt;a href="http://plone.org/products/plone/roadmap/111" target="_blank"&gt;http://plone.org/products/plone/roadmap/111&lt;/a&gt;&lt;/p&gt;</description>
                <author>Chris Crownhart</author>

                
                    <category>python scripts</category>
                
                
                    <category>plone 3</category>
                
                
                    <category>migration</category>
                

                <pubDate>Fri, 28 Aug 2009 09:30:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>Simple way to add lightbox/thickbox support to Plone 3 site</title>
                <guid>http://www.coresoftwaregroup.com/blog/simple-way-to-add-lightbox-thickbox-support-to-plone-3-site</guid>
                <link>http://www.coresoftwaregroup.com/blog/simple-way-to-add-lightbox-thickbox-support-to-plone-3-site</link>
                <description>&lt;p&gt;On the old Core Software Group site, I downloaded thickbox and manually added the css and js files to the portal_css and portal_js registries.  It worked, but was kind of kludgy.&lt;/p&gt;
&lt;p&gt;Thanks to Steve McMahon's &lt;a href="http://pypi.python.org/pypi/Products.pipbox" target="_blank"&gt;Products.pipbox&lt;/a&gt;, it's clean and easy, and gives you a massive amount of flexibility and control.  Here's all I did:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Added Products.pipbox to my eggs section of my buildout.cfg, then ran bin/buildout&lt;/li&gt;
&lt;li&gt;Installed pipbox via quickinstaller&lt;/li&gt;
&lt;li&gt;pipbox adds a property sheet to portal_properties, which for now, you have to edit via the ZMI&lt;/li&gt;
&lt;li&gt;I added the following to /portal_properties/pipbox_properties -&amp;gt; selector specs:&lt;/li&gt;
&lt;ul&gt;
&lt;p class="callout"&gt;{type:'overlay',subtype:'image',selector:'img.image-right,img.image-left,img.image-inline',  urlmatch:'/image_.+$',urlreplace:''}&lt;/p&gt;
&lt;/ul&gt;
&lt;li&gt;That's it.  Now our &lt;a href="../what-can-we-do-for-you/portfolio"&gt;portfolio page&lt;/a&gt; uses the lightbox popups to display screenshots of Plone sites we have built.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Next up:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Figure out how to control the position of the popup box.&lt;/li&gt;
&lt;li&gt;Figure out how to take advantage of AJAX form support in pipbox.&lt;/li&gt;
&lt;li&gt;Figure out how to implement AJAX tabs using pipbox.&lt;/li&gt;
&lt;/ol&gt;</description>
                <author>Chris Crownhart</author>

                
                    <category>plone 3</category>
                
                
                    <category>pipbox</category>
                
                
                    <category>thickbox</category>
                
                
                    <category>lightbox</category>
                

                <pubDate>Wed, 26 Aug 2009 12:15:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>Welcome to our new blog</title>
                <guid>http://www.coresoftwaregroup.com/blog/welcome-to-our-new-blog</guid>
                <link>http://www.coresoftwaregroup.com/blog/welcome-to-our-new-blog</link>
                <description>&lt;p&gt;We at Core Software Group have been working with Zope for almost 10 years now, and with Plone for nearly 7 years!  Man, that is awesome!  I have always believed that Plone is the killer app for Zope, and have thoroughly enjoyed providing Plone consulting services.&lt;/p&gt;
&lt;p&gt;During our journey down the Plone road, we have learned a ton, and it is my hope that we can share what we have learned in the past, and what we will learn in the future, on this blog, so other folks can benefit.&lt;/p&gt;
&lt;p&gt;We have worked on Zope-only applications, built CMF-only applications, supported a variety of Plone versions, and most recently have been migrating old Plone sites to the newer Plone 3 platform.&lt;/p&gt;
&lt;p&gt;There are an enormous amount of resources on the web for helping developers with Plone, but it always seems like the one thing you are working on does not have much documentation.  Additionally, there are just some things that require the "secret decoder ring"!&lt;/p&gt;
&lt;p&gt;When we come across oddities that require you to pat your head and rub your belly at the same time to get Plone to work just right, we will tag them with "secret decoder ring".&lt;/p&gt;
&lt;p&gt;I hope that we can provide useful information to other developers.  If you like what we've done, or have questions about what we can do, please feel free to &lt;a href="../contact-us"&gt;contact us&lt;/a&gt;.&lt;/p&gt;</description>
                <author>Chris Crownhart</author>

                
                    <category>secret decoder ring</category>
                
                
                    <category>plone 3</category>
                

                <pubDate>Sat, 15 Aug 2009 12:45:00 -0600</pubDate>

                
            </item>
        
        
            <item>
                <title>First Post :)</title>
                <guid>http://www.coresoftwaregroup.com/blog/first-post</guid>
                <link>http://www.coresoftwaregroup.com/blog/first-post</link>
                <description>&lt;p&gt;Heh, heh.&lt;/p&gt;</description>
                <author>Chris Crownhart</author>

                
                    <category>news</category>
                

                <pubDate>Thu, 07 May 2009 15:35:00 -0600</pubDate>

                
            </item>
        

    </channel>
</rss>


