Posts in 'Plone' – Page 5

Plone: Varnish Configuration (Cache Hits, Purge Fails)

What a painful, painful day. It’s taken about the entire day, but I’ve finally figured out why our Varnish configuration around here for Plone/Zope hasn’t been accepting PURGE requests. Thus, without accepting purge requests correctly, any content that gets changed in Plone doesn’t get updated in the cache until it times out (or we restart it). Ouch - especially because it affects all sites under virtual hosting, and a lot of these sites have publicly visible content that needs to be available immediately.

So, the problem manifested itself as thus:

  • Cache hits happen
  • Performance was good …

Plone: Re-ordering Folder Contents

Ahhh, a new work week.

The first perplexing puzzle for the week was a seemingly silly idea (it still is) in Plone where it allows you to view the contents of a given folder in batches of 20. Now, combine this concept (which is good) with a concept of being able to re-order items within the folder (which is good too), you end up with not being able to move items between ‘batches’.

Troublesome. There’s nothing obvious that you can do aside from disabling your browser’s JavaScript and using the manual buttons. Nope: not feasible.

Try making your …

Plone How-To: XHTML Compliant Flash Insertion

Wow, it seems easy doesn’t it. Just add an object tag, params, and embed and we’re done, right? Well, sure, if we didn’t want to adhere to W3C standards.

To do the right thing, we need something like this:

<object type="application/x-shockwave-flash" data="movie.swf" width="100" height="100">
    <param name="movie" value="movie.swf" />
    <img src="alt.jpg" width="100" height="100" alt="" />
</object>

Not much to it there, and this is available everywhere on the web. It validates okay, and that’s what we need.

However, if you follow normal procedure for sticking this …

Plone: PloneFormGen Customisations

Another fun problem for me to address today: upgrading to the latest version of Plone (3.1.7 at time of writing) caused my custom PloneFormGen (otherwise known as PFG) view to break in a nasty way:

Module None, line 13, in fgvalidate_base
- <fscontrollervalidator at /site/fgvalidate_base used for /site/registration-form>
- Line 13
Module Products.PloneFormGen.content.form, line 519, in fgvalidate
Module plone.protect.authenticator, line 60, in check
Forbidden: Form authenticator is invalid.

Obviously there’s some new validation code for forms in Plone 3.1+. Thanks to a very simple (and useful!) blog entry: http://www.die-welt …

Rewrite Rules Made Easy

I’ve pretty much got a nice handle on Rewrite rules for Apache. Once you’ve seen a few of them, it’s straight forward enough to replicate for new Plone sites and so forth.

However, to make things even easier on my brain I’ve found this: http://betabug.ch/zope/witch , the Rewrite Rule Witch. Seems like the rules it produces are what I’d expect, which makes me ponder why, if I know they’re right, would I bother.

Reason: easy confirmation and less chance of typos.

Plone: Python Eggs And Development

Welcome to the new year! It’s the start of another journey around the sun and the beginning of work for me. Whilst I’m the only one actually working around here today, I thought I’d take the chance and update with some useful info:

Troublesome Python eggs

Now, much to my amazement, when you’re creating/compiling/whatever Python eggs for Plone you need to actually specify the files you want included in the build. I suppose it’s fair enough, but thought it might have actually done it for me. No such luck!

The SOURCES.txt file …

Plone: Buildout Won’t Install Products.OpenXml

UPDATE: Installation of Products.OpenXml appears to work happily with buildout when I’m using z3c.recipe.staticlxml to build lxml separately from having to easy_install or install system-wide packages.

So it’s almost Christmas time and I’m still slaving away working. It’s all about commitment.

Today in my life I’ve been trying to install the OpenXml product for Plone (using buildout, of course):

david@computer:~/buildout/instance$ ./bin/buildout
Uninstalling zopepy.
Uninstalling instance.
Updating plone.
Updating zope2.
Updating productdistros.
Installing instance.
Getting distribution for 'Products.OpenXml'.
Got Products.OpenXml 1.0.1.
Getting distribution for 'openxmllib' …

Plone: Ploneboard Conversation Editing

I’m back with even more Plone goodness. Turns out Ploneboard has a problem/issue (well, HAD an issue until I went and edited the code on the SVN repository for the Collective of Plone. Read: will not have in the next major release) with redirecting the user after they go and edit a post. So essentially the user ends up getting to a page that says ‘Insufficient privileges’, which is was extremely odd considering I do everything as an admin.

The fix goes a little something like this:

In ploneboard_scripts/comment_redirect_to_conversation change it to be:

# XXX if we ever …

Plone: Page Template Redirects

Was wondering how to get a Plone page template to go to a page before the template actually loads. Now, actually getting Plone to not go to this template would be FAR better, but since we can’t actually modify the functionality of the Favourites content items in the content listings (not easily), I instead modify it’s default view.

Using this:

<head>
    <metal:js fill-slot="javascript_head_slot">
        <script type="text/javascript"
        tal:content="python:'location.href=\''+portal.absolute_url()+'/'+here.remoteUrl+'\';;'">
        </script>
    </metal:js>
</head>

We see that the page reloads to the relevant location as soon as the head JavaScript …

Plone: Relative ‘Recent Changes’ Portlets

The problem I’ve been faced with today on our Plone systems is that I need to created a ‘Recent Changes’ portlet that’s relative to where the user is on the site.

Now, the standard portlet doesn’t do anything for me, so that’s pretty useless. I had a look at the standard code for the portlet too and it’s not really feasible to try and mess with:

<tal:recentlist define="view here/@@recent_view; results here/results;">

However, using a (nasty?) workaround, if we put the classic Recent Changes portlet into play, we can change that above …